Navigator implementation for annotation processing.
Todo
check the spec on how generics are supposed to be handled
| Modifier and Type | Field and Description |
|---|---|
| private final SimpleTypeVisitor8 | baseClassFinder
Implements |
| private static final TypeMirror | DUMMY
see |
| private final ProcessingEnvironment | |
| private final PrimitiveType | |
| private static final Map |
| Access | Constructor and Description |
|---|---|
| public |
| baseClassFinder | back to summary |
|---|---|
| private final SimpleTypeVisitor8<TypeMirror, TypeElement> baseClassFinder Implements | |
| DUMMY | back to summary |
|---|---|
| private static final TypeMirror DUMMY see | |
| env | back to summary |
|---|---|
| private final ProcessingEnvironment env | |
| primitiveByte | back to summary |
|---|---|
| private final PrimitiveType primitiveByte | |
| primitives | back to summary |
|---|---|
| private static final Map<Class<?>, TypeKind> primitives | |
| ApNavigator | back to summary |
|---|---|
| public ApNavigator(ProcessingEnvironment env) | |
| asDecl | back to summary |
|---|---|
| public TypeElement asDecl(TypeMirror m) Implements org. Doc from org. If the given type is an use of class declaration,
returns the type casted as Todo define the exact semantics.
| |
| asDecl | back to summary |
|---|---|
| public TypeElement asDecl(Class<?> c) Implements org. Doc from org. Gets the
| |
| erasure | back to summary |
|---|---|
| public TypeMirror erasure(TypeMirror t) Implements org. Doc from org. Computes the erasure
| |
| getBaseClass | back to summary |
|---|---|
| public TypeMirror getBaseClass(TypeMirror type, TypeElement sup) Implements org. Doc from org. Gets the parameterization of the given base type. For example, given the following
This method works like this:
| |
| getClassLocation | back to summary |
|---|---|
| public Location getClassLocation(TypeElement typeElement) Implements org. Doc from org. Returns a location of the specified class.
| |
| getClassName | back to summary |
|---|---|
| public String getClassName(TypeElement t) Implements org. Doc from org. Gets the fully-qualified name of the class.
("java.lang.Object" for
| |
| getClassShortName | back to summary |
|---|---|
| public String getClassShortName(TypeElement t) Implements org. Doc from org. Gets the short name of the class ("Object" for
| |
| getComponentType | back to summary |
|---|---|
| public TypeMirror getComponentType(TypeMirror t) Implements org. Doc from org. Gets the component type of the array.
| |
| getDeclaredField | back to summary |
|---|---|
| public VariableElement getDeclaredField(TypeElement clazz, String fieldName) Implements org. Doc from org. Gets the named field declared on the given class. This method doesn't visit ancestors, but does recognize non-public fields.
| |
| getDeclaredFields | back to summary |
|---|---|
| public Collection Implements org. Doc from org. Gets all the declared fields of the given class.
| |
| getDeclaredMethods | back to summary |
|---|---|
| public Collection Implements org. Doc from org. Gets all the declared methods of the given class (regardless of their access modifiers, regardless of whether they override methods of the base classes.) Note that this method does not list methods declared on base classes.
| |
| getDeclaringClassForField | back to summary |
|---|---|
| public TypeElement getDeclaringClassForField(VariableElement f) Implements org. Doc from org. Gets the class that declares the given field.
| |
| getDeclaringClassForMethod | back to summary |
|---|---|
| public TypeElement getDeclaringClassForMethod(ExecutableElement m) Implements org. Doc from org. Gets the class that declares the given method.
| |
| getEnumConstants | back to summary |
|---|---|
| public VariableElement[] getEnumConstants(TypeElement clazz) Implements org. Doc from org. Gets the enumeration constants from an enum class.
| |
| getFieldLocation | back to summary |
|---|---|
| public Location getFieldLocation(VariableElement variableElement) Implements org.
| |
| getFieldName | back to summary |
|---|---|
| public String getFieldName(VariableElement f) Implements org. Doc from org. Gets the name of the field.
| |
| getFieldType | back to summary |
|---|---|
| public TypeMirror getFieldType(VariableElement f) Implements org. Doc from org. Gets the type of the field.
| |
| getLocation | back to summary |
|---|---|
| private Location getLocation(Element element) | |
| getLocation | back to summary |
|---|---|
| private Location getLocation(final String name, final TreePath treePath) | |
| getMethodLocation | back to summary |
|---|---|
| public Location getMethodLocation(ExecutableElement executableElement) Implements org.
| |
| getMethodName | back to summary |
|---|---|
| public String getMethodName(ExecutableElement m) Implements org. Doc from org. Gets the name of the method, such as "toString" or "equals".
| |
| getMethodParameters | back to summary |
|---|---|
| public TypeMirror[] getMethodParameters(ExecutableElement m) Implements org. Doc from org. Returns the list of parameters to the method.
| |
| getPackageName | back to summary |
|---|---|
| public String getPackageName(TypeElement clazz) Implements org. Doc from org. Gets the package name of the given class.
| |
| getPrimitive | back to summary |
|---|---|
| public TypeMirror getPrimitive(Class<?> primitiveType) Implements org. Doc from org. Returns the representation for the given primitive type.
| |
| getReturnType | back to summary |
|---|---|
| public TypeMirror getReturnType(ExecutableElement m) Implements org. Doc from org. Gets the return type of a method.
| |
| getSourceClassName | back to summary |
|---|---|
| private String getSourceClassName(Class<?> clazz) | |
| getSuperClass | back to summary |
|---|---|
| public TypeElement getSuperClass(TypeElement typeElement) Implements org. Doc from org. Gets the base class of the specified class.
| |
| getTypeArgument | back to summary |
|---|---|
| public TypeMirror getTypeArgument(TypeMirror typeMirror, int i) Implements org. Doc from org. Gets the i-th type argument from a parameterized type.
For example,
| |
| getTypeName | back to summary |
|---|---|
| public String getTypeName(TypeMirror typeMirror) Implements org. Doc from org. Gets the display name of the type object
| |
| getVoidType | back to summary |
|---|---|
| public TypeMirror getVoidType() Implements org. Doc from org. Gets the representation of the primitive "void" type.
| |
| hasDefaultConstructor | back to summary |
|---|---|
| public boolean hasDefaultConstructor(TypeElement t) Implements org. Doc from org. Returns true if the given class has a no-arg default constructor. The constructor does not need to be public.
| |
| hasModifier | back to summary |
|---|---|
| private boolean hasModifier(Element d, Modifier mod) | |
| isAbstract | back to summary |
|---|---|
| public boolean isAbstract(TypeElement clazz) Implements org. Doc from org. Returns true if this is an abstract class.
| |
| isArray | back to summary |
|---|---|
| public boolean isArray(TypeMirror type) Implements org. Doc from org. Checks if the type is an array type.
| |
| isArrayButNotByteArray | back to summary |
|---|---|
| public boolean isArrayButNotByteArray(TypeMirror t) Implements org. Doc from org. Checks if the type is an array type but not byte[].
| |
| isBridgeMethod | back to summary |
|---|---|
| public boolean isBridgeMethod(ExecutableElement method) Implements org. Doc from org. Returns true if this method is a bridge method as defined in JLS.
| |
| isEnum | back to summary |
|---|---|
| public boolean isEnum(TypeElement t) Implements org. Doc from org. Returns true if this is an enum class.
| |
| isFinal | back to summary |
|---|---|
| public boolean isFinal(TypeElement clazz) Implements org. Doc from org. Returns true if this is a final class.
| |
| isFinalMethod | back to summary |
|---|---|
| public boolean isFinalMethod(ExecutableElement m) Implements org. Doc from org. Returns true if the method is final.
| |
| isInnerClass | back to summary |
|---|---|
| public boolean isInnerClass(TypeElement clazz) Implements org. Doc from org. Returns true if the given class is an inner class. This is only used to improve the error diagnostics, so it's OK to fail to detect some inner classes as such. Note that this method should return false for nested classes (static classes.)
| |
| isInterface | back to summary |
|---|---|
| public boolean isInterface(TypeElement clazz) Implements org. Doc from org. Returns true if 'clazz' is an interface.
| |
| isOverriding | back to summary |
|---|---|
| public boolean isOverriding(ExecutableElement method, TypeElement base) Implements org. Doc from org. Returns true if the given method is overriding another one defined in the base class 'base' or its ancestors.
| |
| isParameterizedType | back to summary |
|---|---|
| public boolean isParameterizedType(TypeMirror typeMirror) Implements org. Doc from org. Returns true if t is a parameterized type.
| |
| isPrimitive | back to summary |
|---|---|
| public boolean isPrimitive(TypeMirror t) Implements org. Doc from org. Checks if the given type is a primitive type.
| |
| isPublicField | back to summary |
|---|---|
| public boolean isPublicField(VariableElement f) Implements org. Doc from org. Returns true if the field is public.
| |
| isPublicMethod | back to summary |
|---|---|
| public boolean isPublicMethod(ExecutableElement m) Implements org. Doc from org. Returns true if the method is public.
| |
| isSameType | back to summary |
|---|---|
| public boolean isSameType(TypeMirror t1, TypeMirror t2) Implements org. Doc from org. Checks if types are the same
| |
| isStaticField | back to summary |
|---|---|
| public boolean isStaticField(VariableElement f) Implements org. Doc from org. Returns true if the field is static.
| |
| isStaticMethod | back to summary |
|---|---|
| public boolean isStaticMethod(ExecutableElement m) Implements org. Doc from org. Returns true if the method is static.
| |
| isSubClassOf | back to summary |
|---|---|
| public boolean isSubClassOf(TypeMirror sub, TypeMirror sup) Implements org. Doc from org. Checks if Todo should this method take T or C?
| |
| isTransient | back to summary |
|---|---|
| public boolean isTransient(VariableElement f) Implements org. Doc from org. Returns true if the field is transient.
| |
| loadObjectFactory | back to summary |
|---|---|
| public TypeElement loadObjectFactory(TypeElement referencePoint, String packageName) Implements org. Doc from org. Finds ObjectFactory for the given referencePoint.
| |
| ref | back to summary |
|---|---|
| public TypeMirror ref(Class<?> c) Implements org. Doc from org. Gets the representation of the given Java type in
| |
| use | back to summary |
|---|---|
| public TypeMirror use(TypeElement t) Implements org. Doc from org. Gets the T for the given C.
| |