Package com.google.auto.value.processor
Class AutoValueTemplateVars
- java.lang.Object
-
- com.google.auto.value.processor.TemplateVars
-
- com.google.auto.value.processor.AutoValueTemplateVars
-
class AutoValueTemplateVars extends TemplateVars
The variables to substitute into the autovalue.vm template.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.StringactualTypesThe generic signature used by the generated subclass for its superclass reference.(package private) com.google.common.collect.ImmutableList<java.lang.String>annotationsThe full spelling of any annotation to add to this class, or an empty list if there are none.(package private) java.lang.StringbuilderActualTypesThe generic signature used by the generated builder subclass for its superclass reference.(package private) java.lang.StringbuilderFormalTypesThe formal generic signature of theAutoValue.Builderclass.(package private) com.google.common.collect.ImmutableMap<java.lang.String,BuilderSpec.PropertyGetter>builderGettersA map from property names to information about the associated property getter.(package private) java.lang.BooleanbuilderIsInterfaceTrue if the builder being implemented is an interface, false if it is an abstract class.(package private) com.google.common.collect.ImmutableMap<java.lang.String,PropertyBuilderClassifier.PropertyBuilder>builderPropertyBuildersA map from property names to information about the associated property builder.(package private) com.google.common.collect.ImmutableSet<AutoValueOrOneOfProcessor.Property>builderRequiredPropertiesProperties that are required to be set.(package private) com.google.common.collect.ImmutableMultimap<java.lang.String,BuilderSpec.PropertySetter>builderSettersA multimap from property names (like foo) to the corresponding setters.(package private) java.lang.StringbuilderTypeNameThe name of the builder type as it should appear in source code, or empty if there is no builder type.(package private) java.util.Optional<SimpleMethod>buildMethodThe builder's build method, often"build".(package private) java.lang.BooleanequalsWhether to generate an equals(Object) method.(package private) java.lang.StringequalsParameterTypeA string representing the parameter type declaration of the equals(Object) method, including any annotations.(package private) java.lang.StringfinalSubclassThe simple name of the final generated subclass.(package private) java.lang.StringformalTypesThe formal generic signature of the class with the@AutoValueannotation and its generated subclass.(package private) java.lang.StringgeneratedThe encoding of theGeneratedclass.(package private) java.lang.StringgwtCompatibleAnnotationThe encoding of the@GwtCompatibleannotation to add to this class, or an empty string if there is none.(package private) java.lang.BooleanhashCodeWhether to generate a hashCode() method.(package private) java.lang.BooleanidentifiersWhether to include identifiers in strings in the generated code.(package private) java.lang.BooleanisFinalTrue if the generated class should be final (there are no extensions that will generate subclasses)(package private) java.lang.StringorigClassThe name of the class with the@AutoValueannotation, including containing classes but not including the package name.(package private) java.lang.StringpkgThe package of the class with the@AutoValueannotation and its generated subclass.(package private) com.google.common.collect.ImmutableSet<AutoValueOrOneOfProcessor.Property>propsThe properties defined by the parent class's abstract methods.(package private) java.lang.StringserialVersionUIDThe text of the serialVersionUID constant, or empty if there is none.(package private) java.lang.StringsimpleClassNameThe simple name of the class with the@AutoValueannotation.(package private) java.lang.StringsubclassThe simple name of the generated subclass.private static TemplateTEMPLATE(package private) com.google.common.collect.ImmutableList<SimpleMethod>toBuilderMethodsAnytoBuilder()methods, that is methods that return the builder type.(package private) java.lang.BooleantoStringWhether to generate a toString() method.(package private) javax.lang.model.util.TypestypesThe type utilities returned byProcessingEnvironment.getTypeUtils().(package private) java.lang.StringwildcardTypesThe generic signature inactualTypeswhere every variable has been replaced by a wildcard, for example<?, ?>.
-
Constructor Summary
Constructors Constructor Description AutoValueTemplateVars()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) TemplateparsedTemplate()-
Methods inherited from class com.google.auto.value.processor.TemplateVars
parsedTemplateForResource, toText
-
-
-
-
Field Detail
-
props
com.google.common.collect.ImmutableSet<AutoValueOrOneOfProcessor.Property> props
The 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.
-
equals
java.lang.Boolean equals
Whether to generate an equals(Object) method.
-
hashCode
java.lang.Boolean hashCode
Whether to generate a hashCode() method.
-
toString
java.lang.Boolean toString
Whether to generate a toString() method.
-
equalsParameterType
java.lang.String equalsParameterType
A string representing the parameter type declaration of the equals(Object) method, including any annotations. Ifequalsis false, this field is ignored (but it must still be non-null).
-
identifiers
java.lang.Boolean identifiers
Whether 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@AutoValueclass.
-
types
javax.lang.model.util.Types types
The type utilities returned byProcessingEnvironment.getTypeUtils().
-
generated
java.lang.String generated
The encoding of theGeneratedclass. Empty if the class is not available.
-
gwtCompatibleAnnotation
java.lang.String gwtCompatibleAnnotation
The encoding of the@GwtCompatibleannotation 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.
-
annotations
com.google.common.collect.ImmutableList<java.lang.String> annotations
The full spelling of any annotation to add to this class, or an empty list if there are none. A non-empty value might look something like"@com.google.common.annotations.GwtCompatible(serializable = true)".
-
serialVersionUID
java.lang.String serialVersionUID
The text of the serialVersionUID constant, or empty if there is none.
-
pkg
java.lang.String pkg
The package of the class with the@AutoValueannotation and its generated subclass.
-
origClass
java.lang.String origClass
The name of the class with the@AutoValueannotation, including containing classes but not including the package name.
-
simpleClassName
java.lang.String simpleClassName
The simple name of the class with the@AutoValueannotation.
-
subclass
java.lang.String subclass
The simple name of the generated subclass.
-
finalSubclass
java.lang.String finalSubclass
The simple name of the final generated subclass. For@AutoValue public static class Foo {}this should always be "AutoValue_Foo".
-
isFinal
java.lang.Boolean isFinal
True if the generated class should be final (there are no extensions that will generate subclasses)
-
formalTypes
java.lang.String formalTypes
The formal generic signature of the class with the@AutoValueannotation and its generated subclass. This is empty, or contains type variables with optional bounds, for example<K, V extends K>.
-
actualTypes
java.lang.String actualTypes
The generic signature used by the generated subclass for its superclass reference. This is empty, or contains only type variables with no bounds, for example<K, V>.
-
wildcardTypes
java.lang.String wildcardTypes
The generic signature inactualTypeswhere every variable has been replaced by a wildcard, for example<?, ?>.
-
builderTypeName
java.lang.String builderTypeName
The name of the builder type as it should appear in source code, or empty if there is no builder type. If classAddresscontains@AutoValue.Builderclass Builder then this will typically be"Address.Builder".
-
builderFormalTypes
java.lang.String builderFormalTypes
The formal generic signature of theAutoValue.Builderclass. This is empty, or contains type variables with optional bounds, for example<K, V extends K>.
-
builderActualTypes
java.lang.String builderActualTypes
The 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
java.lang.Boolean builderIsInterface
True if the builder being implemented is an interface, false if it is an abstract class.
-
buildMethod
java.util.Optional<SimpleMethod> buildMethod
The builder's build method, often"build".
-
builderSetters
com.google.common.collect.ImmutableMultimap<java.lang.String,BuilderSpec.PropertySetter> builderSetters
A 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<java.lang.String,PropertyBuilderClassifier.PropertyBuilder> builderPropertyBuilders
A 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@AutoValuetypes.
-
builderRequiredProperties
com.google.common.collect.ImmutableSet<AutoValueOrOneOfProcessor.Property> builderRequiredProperties
Properties 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<java.lang.String,BuilderSpec.PropertyGetter> builderGetters
A 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> toBuilderMethods
AnytoBuilder()methods, that is methods that return the builder type.
-
TEMPLATE
private static final Template TEMPLATE
-
-
Method Detail
-
parsedTemplate
Template parsedTemplate()
- Specified by:
parsedTemplatein classTemplateVars
-
-