com.sun.tools.jxc.model.nav
Class APTNavigator

java.lang.Object
  extended by com.sun.tools.jxc.model.nav.APTNavigator
All Implemented Interfaces:
Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

public class APTNavigator
extends Object
implements Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

Navigator implementation for APT. TODO: check the spec on how generics are supposed to be handled


Field Summary
 
Fields inherited from interface com.sun.xml.bind.v2.model.nav.Navigator
REFLECTION
 
Constructor Summary
APTNavigator(com.sun.mirror.apt.AnnotationProcessorEnvironment env)
           
 
Method Summary
 com.sun.mirror.declaration.TypeDeclaration asDecl(Class c)
          Gets the C representation for the given class.
 com.sun.mirror.declaration.TypeDeclaration asDecl(com.sun.mirror.type.TypeMirror m)
          If the given type is an use of class declaration, returns the type casted as C.
<T> com.sun.mirror.type.TypeMirror
erasure(com.sun.mirror.type.TypeMirror t)
          Computes the erasure
 com.sun.mirror.declaration.TypeDeclaration findClass(String className, com.sun.mirror.declaration.TypeDeclaration referencePoint)
          Finds the class/interface/enum/annotation of the given name.
 com.sun.mirror.type.TypeMirror getBaseClass(com.sun.mirror.type.TypeMirror type, com.sun.mirror.declaration.TypeDeclaration sup)
          Gets the parameterization of the given base type.
 Location getClassLocation(com.sun.mirror.declaration.TypeDeclaration decl)
          Returns a location of the specified class.
 String getClassName(com.sun.mirror.declaration.TypeDeclaration t)
          Gets the fully-qualified name of the class.
 String getClassShortName(com.sun.mirror.declaration.TypeDeclaration t)
          Gets the short name of the class ("Object" for Object.) For nested classes, this method should just return the inner name.
 com.sun.mirror.type.TypeMirror getComponentType(com.sun.mirror.type.TypeMirror t)
          Gets the component type of the array.
 com.sun.mirror.declaration.FieldDeclaration getDeclaredField(com.sun.mirror.declaration.TypeDeclaration clazz, String fieldName)
          Gets the named field declared on the given class.
 Collection<com.sun.mirror.declaration.FieldDeclaration> getDeclaredFields(com.sun.mirror.declaration.TypeDeclaration c)
          Gets all the declared fields of the given class.
 Collection<com.sun.mirror.declaration.MethodDeclaration> getDeclaredMethods(com.sun.mirror.declaration.TypeDeclaration c)
          Gets all the declared methods of the given class (regardless of their access modifiers, regardless of whether they override methods of the base classes.)
 com.sun.mirror.declaration.ClassDeclaration getDeclaringClassForField(com.sun.mirror.declaration.FieldDeclaration f)
          Gets the class that declares the given field.
 com.sun.mirror.declaration.ClassDeclaration getDeclaringClassForMethod(com.sun.mirror.declaration.MethodDeclaration m)
          Gets the class that declares the given method.
 com.sun.mirror.declaration.FieldDeclaration[] getEnumConstants(com.sun.mirror.declaration.TypeDeclaration clazz)
          Gets the enumeration constants from an enum class.
 Location getFieldLocation(com.sun.mirror.declaration.FieldDeclaration decl)
           
 String getFieldName(com.sun.mirror.declaration.FieldDeclaration f)
          Gets the name of the field.
 com.sun.mirror.type.TypeMirror getFieldType(com.sun.mirror.declaration.FieldDeclaration f)
          Gets the type of the field.
 Location getMethodLocation(com.sun.mirror.declaration.MethodDeclaration decl)
           
 String getMethodName(com.sun.mirror.declaration.MethodDeclaration m)
          Gets the name of the method, such as "toString" or "equals".
 com.sun.mirror.type.TypeMirror[] getMethodParameters(com.sun.mirror.declaration.MethodDeclaration m)
          Returns the list of parameters to the method.
 String getPackageName(com.sun.mirror.declaration.TypeDeclaration clazz)
          Gets the package name of the given class.
 com.sun.mirror.type.TypeMirror getPrimitive(Class primitiveType)
          Returns the representation for the given primitive type.
 com.sun.mirror.type.TypeMirror getReturnType(com.sun.mirror.declaration.MethodDeclaration m)
          Gets the return type of a method.
 com.sun.mirror.declaration.TypeDeclaration getSuperClass(com.sun.mirror.declaration.TypeDeclaration t)
          Gets the base class of the specified class.
 com.sun.mirror.type.TypeMirror getTypeArgument(com.sun.mirror.type.TypeMirror typeMirror, int i)
          Gets the i-th type argument from a parameterized type.
 String getTypeName(com.sun.mirror.type.TypeMirror typeMirror)
          Gets the display name of the type object
 com.sun.mirror.type.TypeMirror getVoidType()
          Gets the representation of the primitive "void" type.
 boolean hasDefaultConstructor(com.sun.mirror.declaration.TypeDeclaration t)
          Returns true if the given class has a no-arg default constructor.
 boolean isAbstract(com.sun.mirror.declaration.TypeDeclaration clazz)
          Returns true if this is an abstract class.
 boolean isArray(com.sun.mirror.type.TypeMirror t)
          Checks if the type is an array type.
 boolean isArrayButNotByteArray(com.sun.mirror.type.TypeMirror t)
          Checks if the type is an array type but not byte[].
 boolean isBridgeMethod(com.sun.mirror.declaration.MethodDeclaration method)
          Returns true if this method is a bridge method as defined in JLS.
 boolean isEnum(com.sun.mirror.declaration.TypeDeclaration t)
          Returns true if this is an enum class.
 boolean isFinal(com.sun.mirror.declaration.TypeDeclaration clazz)
          Returns true if this is a final class.
 boolean isInnerClass(com.sun.mirror.declaration.TypeDeclaration clazz)
          Returns true if the given class is an inner class.
 boolean isInterface(com.sun.mirror.declaration.TypeDeclaration clazz)
          Returns true if 'clazz' is an interface.
 boolean isOverriding(com.sun.mirror.declaration.MethodDeclaration method, com.sun.mirror.declaration.TypeDeclaration base)
          Returns true if the given method is overriding another one defined in the base class 'base' or its ancestors.
 boolean isParameterizedType(com.sun.mirror.type.TypeMirror t)
          Returns true if t is a parameterized type.
 boolean isPrimitive(com.sun.mirror.type.TypeMirror t)
          Checks if the given type is a primitive type.
 boolean isPublicField(com.sun.mirror.declaration.FieldDeclaration f)
          Returns true if the field is public.
 boolean isPublicMethod(com.sun.mirror.declaration.MethodDeclaration m)
          Returns true if the method is public.
 boolean isStaticField(com.sun.mirror.declaration.FieldDeclaration f)
          Returns true if the field is static.
 boolean isStaticMethod(com.sun.mirror.declaration.MethodDeclaration m)
          Returns true if the method is static.
 boolean isSubClassOf(com.sun.mirror.type.TypeMirror sub, com.sun.mirror.type.TypeMirror sup)
          Checks if sub is a sub-type of sup.
 boolean isTransient(com.sun.mirror.declaration.FieldDeclaration f)
          Returns true if the field is transient.
 com.sun.mirror.type.TypeMirror ref(Class c)
          Gets the representation of the given Java type in T.
 com.sun.mirror.type.TypeMirror use(com.sun.mirror.declaration.TypeDeclaration t)
          Gets the T for the given C.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

APTNavigator

public APTNavigator(com.sun.mirror.apt.AnnotationProcessorEnvironment env)
Method Detail

getSuperClass

public com.sun.mirror.declaration.TypeDeclaration getSuperClass(com.sun.mirror.declaration.TypeDeclaration t)
Description copied from interface: Navigator
Gets the base class of the specified class.

Specified by:
getSuperClass in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>
Returns:
null if the parameter represents Object.

getBaseClass

public com.sun.mirror.type.TypeMirror getBaseClass(com.sun.mirror.type.TypeMirror type,
                                                   com.sun.mirror.declaration.TypeDeclaration sup)
Description copied from interface: Navigator
Gets the parameterization of the given base type.

For example, given the following


 interface Foo<T> extends List<List<T>> {}
 interface Bar extends Foo<String> {}
 
This method works like this:

 getBaseClass( Bar, List ) = List<List<String>
 getBaseClass( Bar, Foo  ) = Foo<String>
 getBaseClass( Foo<? extends Number>, Collection ) = Collection<List<? extends Number>>
 getBaseClass( ArrayList<? extends BigInteger>, List ) = List<? extends BigInteger>
 

Specified by:
getBaseClass in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>
Parameters:
type - The type that derives from baseType
sup - The class whose parameterization we are interested in.
Returns:
The use of baseType in type. or null if the type is not assignable to the base type.

getClassName

public String getClassName(com.sun.mirror.declaration.TypeDeclaration t)
Description copied from interface: Navigator
Gets the fully-qualified name of the class. ("java.lang.Object" for Object)

Specified by:
getClassName in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

getTypeName

public String getTypeName(com.sun.mirror.type.TypeMirror typeMirror)
Description copied from interface: Navigator
Gets the display name of the type object

Specified by:
getTypeName in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>
Returns:
a human-readable name that the type represents.

getClassShortName

public String getClassShortName(com.sun.mirror.declaration.TypeDeclaration t)
Description copied from interface: Navigator
Gets the short name of the class ("Object" for Object.) For nested classes, this method should just return the inner name. (for example "Inner" for "com.acme.Outer$Inner".

Specified by:
getClassShortName in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

getDeclaredFields

public Collection<com.sun.mirror.declaration.FieldDeclaration> getDeclaredFields(com.sun.mirror.declaration.TypeDeclaration c)
Description copied from interface: Navigator
Gets all the declared fields of the given class.

Specified by:
getDeclaredFields in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

getDeclaredField

public com.sun.mirror.declaration.FieldDeclaration getDeclaredField(com.sun.mirror.declaration.TypeDeclaration clazz,
                                                                    String fieldName)
Description copied from interface: Navigator
Gets the named field declared on the given class. This method doesn't visit ancestors, but does recognize non-public fields.

Specified by:
getDeclaredField in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>
Returns:
null if not found

getDeclaredMethods

public Collection<com.sun.mirror.declaration.MethodDeclaration> getDeclaredMethods(com.sun.mirror.declaration.TypeDeclaration c)
Description copied from interface: Navigator
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.

Specified by:
getDeclaredMethods in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>
Returns:
can be empty but always non-null.

getDeclaringClassForField

public com.sun.mirror.declaration.ClassDeclaration getDeclaringClassForField(com.sun.mirror.declaration.FieldDeclaration f)
Description copied from interface: Navigator
Gets the class that declares the given field.

Specified by:
getDeclaringClassForField in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

getDeclaringClassForMethod

public com.sun.mirror.declaration.ClassDeclaration getDeclaringClassForMethod(com.sun.mirror.declaration.MethodDeclaration m)
Description copied from interface: Navigator
Gets the class that declares the given method.

Specified by:
getDeclaringClassForMethod in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

getFieldType

public com.sun.mirror.type.TypeMirror getFieldType(com.sun.mirror.declaration.FieldDeclaration f)
Description copied from interface: Navigator
Gets the type of the field.

Specified by:
getFieldType in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

getFieldName

public String getFieldName(com.sun.mirror.declaration.FieldDeclaration f)
Description copied from interface: Navigator
Gets the name of the field.

Specified by:
getFieldName in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

getMethodName

public String getMethodName(com.sun.mirror.declaration.MethodDeclaration m)
Description copied from interface: Navigator
Gets the name of the method, such as "toString" or "equals".

Specified by:
getMethodName in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

getReturnType

public com.sun.mirror.type.TypeMirror getReturnType(com.sun.mirror.declaration.MethodDeclaration m)
Description copied from interface: Navigator
Gets the return type of a method.

Specified by:
getReturnType in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

getMethodParameters

public com.sun.mirror.type.TypeMirror[] getMethodParameters(com.sun.mirror.declaration.MethodDeclaration m)
Description copied from interface: Navigator
Returns the list of parameters to the method.

Specified by:
getMethodParameters in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

isStaticMethod

public boolean isStaticMethod(com.sun.mirror.declaration.MethodDeclaration m)
Description copied from interface: Navigator
Returns true if the method is static.

Specified by:
isStaticMethod in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

isSubClassOf

public boolean isSubClassOf(com.sun.mirror.type.TypeMirror sub,
                            com.sun.mirror.type.TypeMirror sup)
Description copied from interface: Navigator
Checks if sub is a sub-type of sup. TODO: should this method take T or C?

Specified by:
isSubClassOf in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

ref

public com.sun.mirror.type.TypeMirror ref(Class c)
Description copied from interface: Navigator
Gets the representation of the given Java type in T.

Specified by:
ref in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>
Parameters:
c - can be a primitive, array, class, or anything. (therefore the return type has to be T, not C)

use

public com.sun.mirror.type.TypeMirror use(com.sun.mirror.declaration.TypeDeclaration t)
Description copied from interface: Navigator
Gets the T for the given C.

Specified by:
use in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

asDecl

public com.sun.mirror.declaration.TypeDeclaration asDecl(com.sun.mirror.type.TypeMirror m)
Description copied from interface: Navigator
If the given type is an use of class declaration, returns the type casted as C. Otherwise null.

TODO: define the exact semantics.

Specified by:
asDecl in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

asDecl

public com.sun.mirror.declaration.TypeDeclaration asDecl(Class c)
Description copied from interface: Navigator
Gets the C representation for the given class. The behavior is undefined if the class object represents primitives, arrays, and other types that are not class declaration.

Specified by:
asDecl in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

erasure

public <T> com.sun.mirror.type.TypeMirror erasure(com.sun.mirror.type.TypeMirror t)
Description copied from interface: Navigator
Computes the erasure

Specified by:
erasure in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

isAbstract

public boolean isAbstract(com.sun.mirror.declaration.TypeDeclaration clazz)
Description copied from interface: Navigator
Returns true if this is an abstract class.

Specified by:
isAbstract in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

isFinal

public boolean isFinal(com.sun.mirror.declaration.TypeDeclaration clazz)
Description copied from interface: Navigator
Returns true if this is a final class.

Specified by:
isFinal in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

getEnumConstants

public com.sun.mirror.declaration.FieldDeclaration[] getEnumConstants(com.sun.mirror.declaration.TypeDeclaration clazz)
Description copied from interface: Navigator
Gets the enumeration constants from an enum class.

Specified by:
getEnumConstants in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>
Parameters:
clazz - must derive from Enum.
Returns:
can be empty but never null.

getVoidType

public com.sun.mirror.type.TypeMirror getVoidType()
Description copied from interface: Navigator
Gets the representation of the primitive "void" type.

Specified by:
getVoidType in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

getPackageName

public String getPackageName(com.sun.mirror.declaration.TypeDeclaration clazz)
Description copied from interface: Navigator
Gets the package name of the given class.

Specified by:
getPackageName in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>
Returns:
i.e. "", "java.lang" but not null.

findClass

public com.sun.mirror.declaration.TypeDeclaration findClass(String className,
                                                            com.sun.mirror.declaration.TypeDeclaration referencePoint)
Description copied from interface: Navigator
Finds the class/interface/enum/annotation of the given name.

Specified by:
findClass in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>
referencePoint - The class that refers to the specified class.
Returns:
null if not found.

isBridgeMethod

public boolean isBridgeMethod(com.sun.mirror.declaration.MethodDeclaration method)
Description copied from interface: Navigator
Returns true if this method is a bridge method as defined in JLS.

Specified by:
isBridgeMethod in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

isOverriding

public boolean isOverriding(com.sun.mirror.declaration.MethodDeclaration method,
                            com.sun.mirror.declaration.TypeDeclaration base)
Description copied from interface: Navigator
Returns true if the given method is overriding another one defined in the base class 'base' or its ancestors.

Specified by:
isOverriding in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

isInterface

public boolean isInterface(com.sun.mirror.declaration.TypeDeclaration clazz)
Description copied from interface: Navigator
Returns true if 'clazz' is an interface.

Specified by:
isInterface in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

isTransient

public boolean isTransient(com.sun.mirror.declaration.FieldDeclaration f)
Description copied from interface: Navigator
Returns true if the field is transient.

Specified by:
isTransient in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

isInnerClass

public boolean isInnerClass(com.sun.mirror.declaration.TypeDeclaration clazz)
Description copied from interface: Navigator
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.)

Specified by:
isInnerClass in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

isArray

public boolean isArray(com.sun.mirror.type.TypeMirror t)
Description copied from interface: Navigator
Checks if the type is an array type.

Specified by:
isArray in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

isArrayButNotByteArray

public boolean isArrayButNotByteArray(com.sun.mirror.type.TypeMirror t)
Description copied from interface: Navigator
Checks if the type is an array type but not byte[].

Specified by:
isArrayButNotByteArray in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

getComponentType

public com.sun.mirror.type.TypeMirror getComponentType(com.sun.mirror.type.TypeMirror t)
Description copied from interface: Navigator
Gets the component type of the array.

Specified by:
getComponentType in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>
Parameters:
t - must be an array.

getTypeArgument

public com.sun.mirror.type.TypeMirror getTypeArgument(com.sun.mirror.type.TypeMirror typeMirror,
                                                      int i)
Description copied from interface: Navigator
Gets the i-th type argument from a parameterized type. For example, getTypeArgument([Map<Integer,String>],0)=Integer

Specified by:
getTypeArgument in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>
See Also:
Navigator.isParameterizedType(Object)

isParameterizedType

public boolean isParameterizedType(com.sun.mirror.type.TypeMirror t)
Description copied from interface: Navigator
Returns true if t is a parameterized type.

Specified by:
isParameterizedType in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

isPrimitive

public boolean isPrimitive(com.sun.mirror.type.TypeMirror t)
Description copied from interface: Navigator
Checks if the given type is a primitive type.

Specified by:
isPrimitive in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

getPrimitive

public com.sun.mirror.type.TypeMirror getPrimitive(Class primitiveType)
Description copied from interface: Navigator
Returns the representation for the given primitive type.

Specified by:
getPrimitive in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>
Parameters:
primitiveType - must be Class objects like Integer.TYPE.

getClassLocation

public Location getClassLocation(com.sun.mirror.declaration.TypeDeclaration decl)
Description copied from interface: Navigator
Returns a location of the specified class.

Specified by:
getClassLocation in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

getFieldLocation

public Location getFieldLocation(com.sun.mirror.declaration.FieldDeclaration decl)
Specified by:
getFieldLocation in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

getMethodLocation

public Location getMethodLocation(com.sun.mirror.declaration.MethodDeclaration decl)
Specified by:
getMethodLocation in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

hasDefaultConstructor

public boolean hasDefaultConstructor(com.sun.mirror.declaration.TypeDeclaration t)
Description copied from interface: Navigator
Returns true if the given class has a no-arg default constructor. The constructor does not need to be public.

Specified by:
hasDefaultConstructor in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

isStaticField

public boolean isStaticField(com.sun.mirror.declaration.FieldDeclaration f)
Description copied from interface: Navigator
Returns true if the field is static.

Specified by:
isStaticField in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

isPublicMethod

public boolean isPublicMethod(com.sun.mirror.declaration.MethodDeclaration m)
Description copied from interface: Navigator
Returns true if the method is public.

Specified by:
isPublicMethod in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

isPublicField

public boolean isPublicField(com.sun.mirror.declaration.FieldDeclaration f)
Description copied from interface: Navigator
Returns true if the field is public.

Specified by:
isPublicField in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>

isEnum

public boolean isEnum(com.sun.mirror.declaration.TypeDeclaration t)
Description copied from interface: Navigator
Returns true if this is an enum class.

Specified by:
isEnum in interface Navigator<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration>