Package com.google.auto.value.processor
Class AutoValueTemplateVars
java.lang.Object
com.google.auto.value.processor.TemplateVars
com.google.auto.value.processor.AutoValueOrOneOfTemplateVars
com.google.auto.value.processor.AutoValueTemplateVars
The variables to substitute into the autovalue.vm template.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) String
The generic signature used by the generated builder subclass for its superclass reference.(package private) String
The formal generic signature of theAutoValue.Builder
class.(package private) com.google.common.collect.ImmutableMap
<String, BuilderSpec.PropertyGetter> A map from property names to information about the associated property getter.(package private) Boolean
True if the builder being implemented is an interface, false if it is an abstract class.(package private) com.google.common.collect.ImmutableMap
<String, PropertyBuilderClassifier.PropertyBuilder> A map from property names to information about the associated property builder.(package private) com.google.common.collect.ImmutableSet
<AutoValueOrOneOfProcessor.Property> Properties that are required to be set.(package private) com.google.common.collect.ImmutableMultimap
<String, BuilderSpec.PropertySetter> A multimap from property names (like foo) to the corresponding setters.(package private) String
The name of the builder type as it should appear in source code, or empty if there is no builder type.(package private) Optional
<SimpleMethod> The builder's build method, often"build"
.(package private) String
The simple name of the final generated subclass.(package private) String
The encoding of the@GwtCompatible
annotation to add to this class, or an empty string if there is none.(package private) Boolean
Whether to include identifiers in strings in the generated code.(package private) Boolean
True if the generated class should be final (there are no extensions that will generate subclasses)(package private) String
The modifiers (for examplefinal
orabstract
) for the generated subclass, followed by a space if they are not empty.(package private) com.google.common.collect.ImmutableSet
<AutoValueOrOneOfProcessor.Property> The properties defined by the parent class's abstract methods.(package private) String
The text of the serialVersionUID constant, or empty if there is none.(package private) String
The simple name of the generated subclass.private static final Template
(package private) com.google.common.collect.ImmutableList
<SimpleMethod> AnytoBuilder()
methods, that is methods that return the builder type.(package private) Types
The type utilities returned byProcessingEnvironment.getTypeUtils()
.Fields inherited from class com.google.auto.value.processor.AutoValueOrOneOfTemplateVars
actualTypes, annotations, equals, equalsParameterType, formalTypes, generated, hashCode, origClass, pkg, simpleClassName, toString, wildcardTypes
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.google.auto.value.processor.TemplateVars
parsedTemplateForResource, toText
-
Field Details
-
props
com.google.common.collect.ImmutableSet<AutoValueOrOneOfProcessor.Property> propsThe properties defined by the parent class's abstract methods. The elements of this set are in the same order as the original abstract method declarations in the AutoValue class. -
identifiers
Boolean identifiersWhether to include identifiers in strings in the generated code. If false, exception messages will not mention properties by name, andtoString()
will include neither property names nor the name of the@AutoValue
class. -
types
Types typesThe type utilities returned byProcessingEnvironment.getTypeUtils()
. -
gwtCompatibleAnnotation
String gwtCompatibleAnnotationThe encoding of the@GwtCompatible
annotation to add to this class, or an empty string if there is none. A non-empty value will look something like"@`com.google.common.annotations.GwtCompatible`(serializable = true)"
, where the``
represent the encoding used byTypeEncoder
. -
serialVersionUID
String serialVersionUIDThe text of the serialVersionUID constant, or empty if there is none. -
subclass
String subclassThe simple name of the generated subclass. -
finalSubclass
String finalSubclassThe simple name of the final generated subclass. For@AutoValue public static class Foo {}
this should always be "AutoValue_Foo". -
isFinal
Boolean isFinalTrue if the generated class should be final (there are no extensions that will generate subclasses) -
modifiers
String modifiersThe modifiers (for examplefinal
orabstract
) for the generated subclass, followed by a space if they are not empty. -
builderTypeName
String builderTypeNameThe name of the builder type as it should appear in source code, or empty if there is no builder type. If classAddress
contains@AutoValue.Builder
class Builder then this will typically be"Address.Builder"
. -
builderFormalTypes
String builderFormalTypesThe formal generic signature of theAutoValue.Builder
class. This is empty, or contains type variables with optional bounds, for example<K, V extends K>
. -
builderActualTypes
String builderActualTypesThe generic signature used by the generated builder subclass for its superclass reference. This is empty, or contains only type variables with no bounds, for example<K, V>
. -
builderIsInterface
Boolean builderIsInterfaceTrue if the builder being implemented is an interface, false if it is an abstract class. -
buildMethod
Optional<SimpleMethod> buildMethodThe builder's build method, often"build"
. -
builderSetters
com.google.common.collect.ImmutableMultimap<String,BuilderSpec.PropertySetter> builderSettersA multimap from property names (like foo) to the corresponding setters. The same property may be set by more than one setter. For example, an ImmutableList might be set bysetFoo(ImmutableList<String>)
andsetFoo(String[])
. -
builderPropertyBuilders
com.google.common.collect.ImmutableMap<String,PropertyBuilderClassifier.PropertyBuilder> builderPropertyBuildersA map from property names to information about the associated property builder. A property called foo (defined by a method foo() or getFoo()) can have a property builder called fooBuilder(). The type of foo must be a type that has an associated builder following certain conventions. Guava immutable types such as ImmutableList follow those conventions, as do many@AutoValue
types. -
builderRequiredProperties
com.google.common.collect.ImmutableSet<AutoValueOrOneOfProcessor.Property> builderRequiredPropertiesProperties that are required to be set. A property must be set explicitly except in the following cases:- it is
@Nullable
(in which case it defaults to null); - it is
Optional
(in which case it defaults to empty); - it has a property-builder method (in which case it defaults to empty).
- it is
-
builderGetters
com.google.common.collect.ImmutableMap<String,BuilderSpec.PropertyGetter> builderGettersA map from property names to information about the associated property getter. A property called foo (defined by a method foo() or getFoo()) can have a property getter method with the same name (foo() or getFoo()) and either the same return type or an Optional (or OptionalInt, etc) wrapping it. -
toBuilderMethods
com.google.common.collect.ImmutableList<SimpleMethod> toBuilderMethodsAnytoBuilder()
methods, that is methods that return the builder type. -
TEMPLATE
-
-
Constructor Details
-
AutoValueTemplateVars
AutoValueTemplateVars()
-
-
Method Details
-
parsedTemplate
Template parsedTemplate()- Specified by:
parsedTemplate
in classTemplateVars
-