Element that the corresponding properties are defined by. This is
ExecutableElement for AutoValue, where properties are defined by abstract methods,
and VariableElement for AutoBuilder, where they are defined by constructor or method
parameters.
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final javax. | |
| private final Set | |
| private final javax. | |
| private final EclipseHack | |
| private final javax. | |
| private final ErrorReporter | |
| private final Nullables | |
| private final ImmutableSet | |
| private final Multimap | |
| private final Map | |
| private final Multimap | |
| private final ImmutableMap | rewrittenPropertyTypes
Property types, rewritten to refer to type variables in the builder. |
| private boolean | |
| private static final Equivalence | |
| private final javax. |
| Access | Constructor and Description |
|---|---|
| pack-priv | BuilderMethodClassifier(ErrorReporter errorReporter, javax.
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv abstract String | |
| pack-priv ImmutableMap | |
| pack-priv javax. | builderMethodReturnType(javax.
Returns the return type of the given method from the builder. |
| pack-priv Set | |
| pack-priv abstract void | checkForFailedJavaBean(javax.
Checks for failed JavaBean usage when a method that looks like a setter doesn't actually match anything, and emits a compiler Note if detected. |
| private void | |
| private void | classifyMethod(javax.
Classifies a method and update the state of this object based on what is found. |
| private void | classifyMethodNoArgs(javax.
Classifies a method given that it has no arguments. |
| private void | classifyMethodOneArg(javax.
Classifies a method given that it has one argument. |
| pack-priv boolean | classifyMethods(Iterable<javax.
Classifies the given methods and sets the state of this object based on what is found. |
| private boolean | Returns: true if method has been classified successfullyA method to classify methodClassifies a method given that it has one argument and is a property builder with a parameter,
like |
| private ImmutableList | copyOfMethods(javax.
Returns |
| pack-priv abstract String | fooBuilderMustMatch()
A string describing what a property builder for property |
| private Optional | getConvertingSetterFunction(ImmutableList<javax.
Returns an |
| private Optional | Returns: a function that maps a string parameter to a method call using that parameter. For example it might mapfoo to ImmutableList.copyOf(foo).the candidate method to do the copy, copyOfMethod,ImmutableSet.copyOf(Collection<? extends E>) or ImmutableSet.copyOf(E[]) in the
examples.the type of the property to be set, targetType,ImmutableSet<T> in the example.the type of the setter parameter, parameterTypeSet<? extends T> in the example.Returns an |
| private Optional | getSetterFunction(E propertyElement, javax.
Returns an |
| pack-priv abstract String | getterMustMatch()
A string describing what a builder getter must match: a property method for AutoValue, a parameter for AutoBuilder. |
| pack-priv abstract javax. | originalPropertyType(E propertyElement)
Returns the property type as it appears on the original source program element. |
| private static String | |
| pack-priv abstract ImmutableBiMap | |
| pack-priv abstract Optional | propertyForBuilderGetter(javax.
Returns the name of the property that the given no-arg builder method queries, if any. |
| private boolean | propertyIsNullable(String property)
True if the given property is nullable, either because its type has a |
| pack-priv Map | |
| pack-priv ImmutableMultimap | |
| pack-priv abstract String | propertyString(E propertyElement)
A string identifying the given property element, which is a method for AutoValue or a parameter for AutoBuilder. |
| builderGetters | back to summary |
|---|---|
| private final Map<String, BuilderSpec. | |
| builderType | back to summary |
|---|---|
| private final javax. | |
| buildMethods | back to summary |
|---|---|
| private final Set<javax. | |
| builtType | back to summary |
|---|---|
| private final javax. | |
| eclipseHack | back to summary |
|---|---|
| private final EclipseHack eclipseHack | |
| elementUtils | back to summary |
|---|---|
| private final javax. | |
| errorReporter | back to summary |
|---|---|
| private final ErrorReporter errorReporter | |
| nullables | back to summary |
|---|---|
| private final Nullables nullables | |
| propertiesWithDefaults | back to summary |
|---|---|
| private final ImmutableSet<String> propertiesWithDefaults | |
| propertyNameToPrefixedSetters | back to summary |
|---|---|
| private final Multimap<String, BuilderSpec. | |
| propertyNameToPropertyBuilder | back to summary |
|---|---|
| private final Map<String, PropertyBuilderClassifier. | |
| propertyNameToUnprefixedSetters | back to summary |
|---|---|
| private final Multimap<String, BuilderSpec. | |
| rewrittenPropertyTypes | back to summary |
|---|---|
| private final ImmutableMap<String, javax. Property types, rewritten to refer to type variables in the builder. For example, suppose you
have Importantly, this rewrite loses type annotations, so when those are important we must
be careful to look at the original type as reported by the | |
| settersPrefixed | back to summary |
|---|---|
| private boolean settersPrefixed | |
| TYPE_EQUIVALENCE | back to summary |
|---|---|
| private static final Equivalence<javax. | |
| typeUtils | back to summary |
|---|---|
| private final javax. | |
| BuilderMethodClassifier | back to summary |
|---|---|
| pack-priv BuilderMethodClassifier(ErrorReporter errorReporter, javax. | |
| autoWhat | back to summary |
|---|---|
| pack-priv abstract String autoWhat() A string describing what sort of Auto this is, | |
| builderGetters | back to summary |
|---|---|
| pack-priv ImmutableMap Returns the set of properties that have getters in the builder. If a property is defined by an
abstract method in the | |
| builderMethodReturnType | back to summary |
|---|---|
| pack-priv javax. Returns the return type of the given method from the builder. This should be the final type of the method when any bound type variables are substituted. Consider this example:
If the builder is ChildBuilder then the return type of setFoo is also ChildBuilder, and not B as its getReturnType() method would claim.
If the caller is in a version of Eclipse with this bug then the | |
| buildMethods | back to summary |
|---|---|
| pack-priv Set Returns the methods that were identified as | |
| checkForFailedJavaBean | back to summary |
|---|---|
| pack-priv abstract void checkForFailedJavaBean(javax. Checks for failed JavaBean usage when a method that looks like a setter doesn't actually match anything, and emits a compiler Note if detected. A frequent source of problems is where the JavaBeans conventions have been followed for most but not all getters. Then AutoValue considers that they haven't been followed at all, so you might have a property called getFoo where you thought it was called just foo, and you might not understand why your setter called setFoo is rejected (it would have to be called setGetFoo). This is not relevant for AutoBuilder, which uses parameter names rather than getters. The parameter names are unambiguously the same as the property names. | |
| classifyGetter | back to summary |
|---|---|
| private void classifyGetter(javax. | |
| classifyMethod | back to summary |
|---|---|
| private void classifyMethod(javax. Classifies a method and update the state of this object based on what is found. | |
| classifyMethodNoArgs | back to summary |
|---|---|
| private void classifyMethodNoArgs(javax. Classifies a method given that it has no arguments. Currently a method with no arguments can be
a | |
| classifyMethodOneArg | back to summary |
|---|---|
| private void classifyMethodOneArg(javax. Classifies a method given that it has one argument. A method with one argument can be:
| |
| classifyMethods | back to summary |
|---|---|
| pack-priv boolean classifyMethods(Iterable<javax. Classifies the given methods and sets the state of this object based on what is found. | |
| classifyPropertyBuilderOneArg | back to summary |
|---|---|
| private boolean classifyPropertyBuilderOneArg(javax. Classifies a method given that it has one argument and is a property builder with a parameter,
like
| |
| copyOfMethods | back to summary |
|---|---|
| private ImmutableList Returns | |
| fooBuilderMustMatch | back to summary |
|---|---|
| pack-priv abstract String fooBuilderMustMatch() A string describing what a property builder for property | |
| getConvertingSetterFunction | back to summary |
|---|---|
| private Optional Returns an | |
| getConvertingSetterFunction | back to summary |
|---|---|
| private Optional Returns an The example here is deliberately complicated, in that it has a type parameter of its own,
presumably because the
| |
| getSetterFunction | back to summary |
|---|---|
| private Optional Returns an | |
| getterMustMatch | back to summary |
|---|---|
| pack-priv abstract String getterMustMatch() A string describing what a builder getter must match: a property method for AutoValue, a parameter for AutoBuilder. | |
| originalPropertyType | back to summary |
|---|---|
| pack-priv abstract javax. Returns the property type as it appears on the original source program element. This can be
different from the type stored in | |
| prefixWithSet | back to summary |
|---|---|
| private static String prefixWithSet(String propertyName) | |
| propertyElements | back to summary |
|---|---|
| pack-priv abstract ImmutableBiMap Returns a map from property names to the corresponding source program elements. For AutoValue,
these elements are the abstract getter methods in the | |
| propertyForBuilderGetter | back to summary |
|---|---|
| pack-priv abstract Optional Returns the name of the property that the given no-arg builder method queries, if
any. For example, if your | |
| propertyIsNullable | back to summary |
|---|---|
| private boolean propertyIsNullable(String property) True if the given property is nullable, either because its type has a | |
| propertyNameToPropertyBuilder | back to summary |
|---|---|
| pack-priv Map | |
| propertyNameToSetters | back to summary |
|---|---|
| pack-priv ImmutableMultimap Returns a multimap from the name of a property to the methods that set it. If the property is
defined by an abstract method in the | |
| propertyString | back to summary |
|---|---|
| pack-priv abstract String propertyString(E propertyElement) A string identifying the given property element, which is a method for AutoValue or a parameter for AutoBuilder. | |