Class PropertyBuilderClassifier
java.lang.Object
com.google.auto.value.processor.PropertyBuilderClassifier
Classifies methods inside builder types that return builders for properties. For example, if
@AutoValue class Foo has a method ImmutableList<String> bar() then Foo.Builder
can have a method ImmutableList.Builder<String> barBuilder(). This class checks that a
method like barBuilder() follows the rules, and if so constructs a PropertyBuilderClassifier.PropertyBuilder instance with information about barBuilder.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInformation about a property builder, referenced from the autovalue.vm template. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.google.common.collect.ImmutableSet<String> private final BuilderMethodClassifierprivate static final Stringprivate final EclipseHackprivate final Elementsprivate final ErrorReporterprivate final com.google.common.collect.ImmutableBiMap<ExecutableElement, String> private final Types -
Constructor Summary
ConstructorsConstructorDescriptionPropertyBuilderClassifier(ErrorReporter errorReporter, Types typeUtils, Elements elementUtils, BuilderMethodClassifier builderMethodClassifier, com.google.common.collect.ImmutableBiMap<ExecutableElement, String> getterToPropertyName, EclipseHack eclipseHack) -
Method Summary
Modifier and TypeMethodDescriptionprivate Optional<ExecutableElement> addAllPutAll(TypeElement barBuilderTypeElement) private Optional<ExecutableElement> builderMaker(Map<String, ExecutableElement> barNoArgMethods, TypeElement barBuilderTypeElement) private static booleanisNullable(ExecutableElement getter) (package private) Optional<PropertyBuilderClassifier.PropertyBuilder> makePropertyBuilder(ExecutableElement method, String property) private Map<String, ExecutableElement> noArgMethodsOf(TypeElement type)
-
Field Details
-
errorReporter
-
typeUtils
-
elementUtils
-
builderMethodClassifier
-
getterToPropertyName
private final com.google.common.collect.ImmutableBiMap<ExecutableElement, String> getterToPropertyName -
eclipseHack
-
COM_GOOGLE_COMMON_COLLECT_IMMUTABLE
-
BUILDER_METHOD_NAMES
-
-
Constructor Details
-
PropertyBuilderClassifier
PropertyBuilderClassifier(ErrorReporter errorReporter, Types typeUtils, Elements elementUtils, BuilderMethodClassifier builderMethodClassifier, com.google.common.collect.ImmutableBiMap<ExecutableElement, String> getterToPropertyName, EclipseHack eclipseHack)
-
-
Method Details
-
makePropertyBuilder
Optional<PropertyBuilderClassifier.PropertyBuilder> makePropertyBuilder(ExecutableElement method, String property) -
builderMaker
private Optional<ExecutableElement> builderMaker(Map<String, ExecutableElement> barNoArgMethods, TypeElement barBuilderTypeElement) -
noArgMethodsOf
-
addAllPutAll
-
isNullable
-