• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2012 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.google.auto.value.processor;
17 
18 import com.google.escapevelocity.Template;
19 
20 /**
21  * The variables to substitute into the autovalue.vm template.
22  *
23  * @author emcmanus@google.com (Éamonn McManus)
24  */
25 @SuppressWarnings("unused") // the fields in this class are only read via reflection
26 class AutoValueTemplateVars extends AutoValueOrBuilderTemplateVars {
27 
28   /**
29    * The encoding of the {@code @GwtCompatible} annotation to add to this class, or an empty string
30    * if there is none. A non-empty value will look something like {@code
31    * "@`com.google.common.annotations.GwtCompatible`(serializable = true)"}, where the {@code ``}
32    * represent the encoding used by {@link TypeEncoder}.
33    */
34   String gwtCompatibleAnnotation;
35 
36   /** The simple name of the generated subclass. */
37   String subclass;
38   /**
39    * The modifiers (for example {@code final} or {@code abstract}) for the generated subclass,
40    * followed by a space if they are not empty.
41    */
42   String modifiers;
43 
44   private static final Template TEMPLATE = parsedTemplateForResource("autovalue.vm");
45 
46   @Override
parsedTemplate()47   Template parsedTemplate() {
48     return TEMPLATE;
49   }
50 }
51