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

java.lang.Object
  extended by com.sun.tools.jxc.model.nav.ApNavigator
All Implemented Interfaces:
com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

public class ApNavigator
extends Object
implements com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

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

Author:
Kohsuke Kawaguchi (kk@kohsuke.org)

Field Summary
 
Fields inherited from interface com.sun.xml.bind.v2.model.nav.Navigator
REFLECTION
 
Constructor Summary
ApNavigator(ProcessingEnvironment env)
           
 
Method Summary
 TypeElement asDecl(Class c)
           
 TypeElement asDecl(TypeMirror m)
           
 TypeMirror erasure(TypeMirror t)
           
 TypeElement findClass(String className, TypeElement referencePoint)
           
 TypeMirror getBaseClass(TypeMirror type, TypeElement sup)
           
 com.sun.xml.bind.v2.runtime.Location getClassLocation(TypeElement typeElement)
           
 String getClassName(TypeElement t)
           
 String getClassShortName(TypeElement t)
           
 TypeMirror getComponentType(TypeMirror t)
           
 VariableElement getDeclaredField(TypeElement clazz, String fieldName)
           
 Collection<VariableElement> getDeclaredFields(TypeElement typeElement)
           
 Collection<ExecutableElement> getDeclaredMethods(TypeElement typeElement)
           
 TypeElement getDeclaringClassForField(VariableElement f)
           
 TypeElement getDeclaringClassForMethod(ExecutableElement m)
           
 VariableElement[] getEnumConstants(TypeElement clazz)
           
 com.sun.xml.bind.v2.runtime.Location getFieldLocation(VariableElement variableElement)
           
 String getFieldName(VariableElement f)
           
 TypeMirror getFieldType(VariableElement f)
           
 com.sun.xml.bind.v2.runtime.Location getMethodLocation(ExecutableElement executableElement)
           
 String getMethodName(ExecutableElement m)
           
 TypeMirror[] getMethodParameters(ExecutableElement m)
           
 String getPackageName(TypeElement clazz)
           
 TypeMirror getPrimitive(Class primitiveType)
           
 TypeMirror getReturnType(ExecutableElement m)
           
 TypeElement getSuperClass(TypeElement typeElement)
           
 TypeMirror getTypeArgument(TypeMirror typeMirror, int i)
           
 String getTypeName(TypeMirror typeMirror)
           
 TypeMirror getVoidType()
           
 boolean hasDefaultConstructor(TypeElement t)
           
 boolean isAbstract(TypeElement clazz)
           
 boolean isArray(TypeMirror type)
           
 boolean isArrayButNotByteArray(TypeMirror t)
           
 boolean isBridgeMethod(ExecutableElement method)
           
 boolean isEnum(TypeElement t)
           
 boolean isFinal(TypeElement clazz)
           
 boolean isFinalMethod(ExecutableElement m)
           
 boolean isInnerClass(TypeElement clazz)
           
 boolean isInterface(TypeElement clazz)
           
 boolean isOverriding(ExecutableElement method, TypeElement base)
           
 boolean isParameterizedType(TypeMirror typeMirror)
           
 boolean isPrimitive(TypeMirror t)
           
 boolean isPublicField(VariableElement f)
           
 boolean isPublicMethod(ExecutableElement m)
           
 boolean isSameType(TypeMirror t1, TypeMirror t2)
           
 boolean isStaticField(VariableElement f)
           
 boolean isStaticMethod(ExecutableElement m)
           
 boolean isSubClassOf(TypeMirror sub, TypeMirror sup)
           
 boolean isTransient(VariableElement f)
           
 TypeMirror ref(Class c)
           
 TypeMirror use(TypeElement t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApNavigator

public ApNavigator(ProcessingEnvironment env)
Method Detail

getSuperClass

public TypeElement getSuperClass(TypeElement typeElement)
Specified by:
getSuperClass in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getBaseClass

public TypeMirror getBaseClass(TypeMirror type,
                               TypeElement sup)
Specified by:
getBaseClass in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getClassName

public String getClassName(TypeElement t)
Specified by:
getClassName in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getTypeName

public String getTypeName(TypeMirror typeMirror)
Specified by:
getTypeName in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getClassShortName

public String getClassShortName(TypeElement t)
Specified by:
getClassShortName in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getDeclaredFields

public Collection<VariableElement> getDeclaredFields(TypeElement typeElement)
Specified by:
getDeclaredFields in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getDeclaredField

public VariableElement getDeclaredField(TypeElement clazz,
                                        String fieldName)
Specified by:
getDeclaredField in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getDeclaredMethods

public Collection<ExecutableElement> getDeclaredMethods(TypeElement typeElement)
Specified by:
getDeclaredMethods in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getDeclaringClassForField

public TypeElement getDeclaringClassForField(VariableElement f)
Specified by:
getDeclaringClassForField in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getDeclaringClassForMethod

public TypeElement getDeclaringClassForMethod(ExecutableElement m)
Specified by:
getDeclaringClassForMethod in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getFieldType

public TypeMirror getFieldType(VariableElement f)
Specified by:
getFieldType in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getFieldName

public String getFieldName(VariableElement f)
Specified by:
getFieldName in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getMethodName

public String getMethodName(ExecutableElement m)
Specified by:
getMethodName in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getReturnType

public TypeMirror getReturnType(ExecutableElement m)
Specified by:
getReturnType in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getMethodParameters

public TypeMirror[] getMethodParameters(ExecutableElement m)
Specified by:
getMethodParameters in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isStaticMethod

public boolean isStaticMethod(ExecutableElement m)
Specified by:
isStaticMethod in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isFinalMethod

public boolean isFinalMethod(ExecutableElement m)
Specified by:
isFinalMethod in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isSubClassOf

public boolean isSubClassOf(TypeMirror sub,
                            TypeMirror sup)
Specified by:
isSubClassOf in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

ref

public TypeMirror ref(Class c)
Specified by:
ref in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

use

public TypeMirror use(TypeElement t)
Specified by:
use in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

asDecl

public TypeElement asDecl(TypeMirror m)
Specified by:
asDecl in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

asDecl

public TypeElement asDecl(Class c)
Specified by:
asDecl in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

erasure

public TypeMirror erasure(TypeMirror t)
Specified by:
erasure in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isAbstract

public boolean isAbstract(TypeElement clazz)
Specified by:
isAbstract in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isFinal

public boolean isFinal(TypeElement clazz)
Specified by:
isFinal in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getEnumConstants

public VariableElement[] getEnumConstants(TypeElement clazz)
Specified by:
getEnumConstants in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getVoidType

public TypeMirror getVoidType()
Specified by:
getVoidType in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getPackageName

public String getPackageName(TypeElement clazz)
Specified by:
getPackageName in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

findClass

public TypeElement findClass(String className,
                             TypeElement referencePoint)
Specified by:
findClass in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isBridgeMethod

public boolean isBridgeMethod(ExecutableElement method)
Specified by:
isBridgeMethod in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isOverriding

public boolean isOverriding(ExecutableElement method,
                            TypeElement base)
Specified by:
isOverriding in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isInterface

public boolean isInterface(TypeElement clazz)
Specified by:
isInterface in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isTransient

public boolean isTransient(VariableElement f)
Specified by:
isTransient in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isInnerClass

public boolean isInnerClass(TypeElement clazz)
Specified by:
isInnerClass in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isSameType

public boolean isSameType(TypeMirror t1,
                          TypeMirror t2)
Specified by:
isSameType in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isArray

public boolean isArray(TypeMirror type)
Specified by:
isArray in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isArrayButNotByteArray

public boolean isArrayButNotByteArray(TypeMirror t)
Specified by:
isArrayButNotByteArray in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getComponentType

public TypeMirror getComponentType(TypeMirror t)
Specified by:
getComponentType in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getTypeArgument

public TypeMirror getTypeArgument(TypeMirror typeMirror,
                                  int i)
Specified by:
getTypeArgument in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isParameterizedType

public boolean isParameterizedType(TypeMirror typeMirror)
Specified by:
isParameterizedType in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isPrimitive

public boolean isPrimitive(TypeMirror t)
Specified by:
isPrimitive in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getPrimitive

public TypeMirror getPrimitive(Class primitiveType)
Specified by:
getPrimitive in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getClassLocation

public com.sun.xml.bind.v2.runtime.Location getClassLocation(TypeElement typeElement)
Specified by:
getClassLocation in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getFieldLocation

public com.sun.xml.bind.v2.runtime.Location getFieldLocation(VariableElement variableElement)
Specified by:
getFieldLocation in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

getMethodLocation

public com.sun.xml.bind.v2.runtime.Location getMethodLocation(ExecutableElement executableElement)
Specified by:
getMethodLocation in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

hasDefaultConstructor

public boolean hasDefaultConstructor(TypeElement t)
Specified by:
hasDefaultConstructor in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isStaticField

public boolean isStaticField(VariableElement f)
Specified by:
isStaticField in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isPublicMethod

public boolean isPublicMethod(ExecutableElement m)
Specified by:
isPublicMethod in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isPublicField

public boolean isPublicField(VariableElement f)
Specified by:
isPublicField in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>

isEnum

public boolean isEnum(TypeElement t)
Specified by:
isEnum in interface com.sun.xml.bind.v2.model.nav.Navigator<TypeMirror,TypeElement,VariableElement,ExecutableElement>


Copyright © 2005-2012 Oracle Corporation. All Rights Reserved.