| Modifier and Type | Class and Description |
|---|---|
| private static class | TypeSimplifier.
The spelling that should be used to refer to a given class, and an indication of whether it should be imported. |
| Modifier and Type | Field and Description |
|---|---|
| private static final javax.lang.model.type.TypeVisitor | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| pack-priv | TypeSimplifier(javax.
the result of elementUtils,ProcessingEnvironment.getElementUtils() for the
current annotation processing environment.the result of typeUtils,ProcessingEnvironment.getTypeUtils() for the current
annotation processing environment.the name of the package from which classes will be referenced. Classes that
are in the same package do not need to be imported. packageName, Set<javax.the types that will be referenced. types,a base class that the class containing the references will extend. This is needed
because nested classes in that class or one of its ancestors are in scope in the generated
subclass, so a reference to another class with the same name as one of them is ambiguous. baseMakes a new simplifier for the given package and set of types. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static String | |
| private static Set | |
| pack-priv static String | classNameOf(javax.
Returns the name of the given type, including any enclosing types but not the package. |
| private static Map | Returns: a map where the keys are fully-qualified types and the corresponding values indicate whether the type should be imported, and how the type should be spelled in the source code.The name of the package where the class containing these references is
defined. Other classes within the same package do not need to be imported. codePackageName, Set<javax.The complete set of declared types (classes and interfaces) that will be
referenced in the generated code. referenced,The complete set of declared types (classes and interfaces) that are defined
within the scope of the generated class (i.e. nested somewhere in its superclass chain, or
in its interface set) definedGiven a set of referenced types, works out which of them should be imported and what the resulting spelling of each one is. |
| pack-priv static boolean | isCastingUnchecked(javax.
Returns true if casting to the given type will elicit an unchecked warning from the compiler. |
| private static boolean | |
| private static String | javaLangSpelling(javax.
Handles the tricky case where the class being referred to is in |
| private static Set | nonPrivateDeclaredTypes(javax.
Finds all types that are declared with non private visibility by the given |
| pack-priv static String | packageNameOf(javax.
Returns the name of the package that the given type is in. If the type is in the default (unnamed) package then the name is the empty string. |
| pack-priv static String | |
| pack-priv String | |
| private static javax. | |
| private static Set | topLevelTypes(javax.
Finds the top-level types for all the declared types (classes and interfaces) in the given
|
| pack-priv ImmutableSortedSet | |
| private static boolean |
| CASTING_UNCHECKED_VISITOR | back to summary |
|---|---|
| private static final javax.lang.model.type.TypeVisitor<Boolean, Void> CASTING_UNCHECKED_VISITOR | |
| imports | back to summary |
|---|---|
| private final Map<String, TypeSimplifier. | |
| TypeSimplifier | back to summary |
|---|---|
| pack-priv TypeSimplifier(javax. Makes a new simplifier for the given package and set of types.
| |
| actualTypeParametersString | back to summary |
|---|---|
| pack-priv static String actualTypeParametersString(javax. | |
| ambiguousNames | back to summary |
|---|---|
| private static Set | |
| classNameOf | back to summary |
|---|---|
| pack-priv static String classNameOf(javax. Returns the name of the given type, including any enclosing types but not the package. | |
| findImports | back to summary |
|---|---|
| private static Map Given a set of referenced types, works out which of them should be imported and what the resulting spelling of each one is. This method operates on a
| |
| isCastingUnchecked | back to summary |
|---|---|
| pack-priv static boolean isCastingUnchecked(javax. Returns true if casting to the given type will elicit an unchecked warning from the compiler.
Only generic types such as | |
| isJavaLangObject | back to summary |
|---|---|
| private static boolean isJavaLangObject(javax. | |
| javaLangSpelling | back to summary |
|---|---|
| private static String javaLangSpelling(javax. Handles the tricky case where the class being referred to is in | |
| nonPrivateDeclaredTypes | back to summary |
|---|---|
| private static Set Finds all types that are declared with non private visibility by the given | |
| packageNameOf | back to summary |
|---|---|
| pack-priv static String packageNameOf(javax. Returns the name of the package that the given type is in. If the type is in the default (unnamed) package then the name is the empty string. | |
| simpleNameOf | back to summary |
|---|---|
| pack-priv static String simpleNameOf(String s) | |
| simplifiedClassName | back to summary |
|---|---|
| pack-priv String simplifiedClassName(javax. | |
| topLevelType | back to summary |
|---|---|
| private static javax. | |
| topLevelTypes | back to summary |
|---|---|
| private static Set Finds the top-level types for all the declared types (classes and interfaces) in the given
The returned set contains only top-level types. If we reference | |
| typesToImport | back to summary |
|---|---|
| pack-priv ImmutableSortedSet Returns the set of types to import. We import every type that is neither in java.lang nor in the package containing the AutoValue class, provided that the result refers to the type unambiguously. For example, if there is a property of type java.util.Map.Entry then we will import java.util.Map.Entry and refer to the property as Entry. We could also import just java.util.Map in this case and refer to Map.Entry, but currently we never do that. | |
| uncheckedTypeArgument | back to summary |
|---|---|
| private static boolean uncheckedTypeArgument(javax. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final boolean | |
| pack-priv final String |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| importIt | back to summary |
|---|---|
| pack-priv final boolean importIt | |
| spelling | back to summary |
|---|---|
| pack-priv final String spelling | |
| Spelling | back to summary |
|---|---|
| pack-priv Spelling(String spelling, boolean importIt) | |