Package com.sun.tools.xjc.model.nav
Class NavigatorImpl
java.lang.Object
com.sun.tools.xjc.model.nav.NavigatorImpl
Navigator
implementation for XJC.
Most of the Navigator methods are used for parsing the model, which doesn't happen
in XJC. So Most of the methods aren't really implemented. Implementations should
be filled in as needed.- Author:
- Kohsuke Kawaguchi
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionIf the given type is an use of class declaration, returns the type casted asC
.Gets theC
representation for the given class.static NClass
static final NType
static NType
createParameterizedType
(NClass rawType, NType... args) Creates aNType
representation for a parameterized typeRawType<ParamType1,ParamType2,...>
.static NType
createParameterizedType
(Class rawType, NType... args) <T> NType
Computes the erasuregetBaseClass
(NType nt, NClass base) Gets the parameterization of the given base type.Returns a location of the specified class.getClassName
(NClass nClass) Gets the fully-qualified name of the class.getClassShortName
(NClass nClass) Gets the short name of the class ("Object" forObject
.) For nested classes, this method should just return the inner name.getComponentType
(NType nType) Gets the component type of the array.getDeclaredField
(NClass clazz, String fieldName) Gets the named field declared on the given class.Collection<? extends Void>
getDeclaredFields
(NClass nClass) Gets all the declared fields of the given class.Collection<? extends Void>
getDeclaredMethods
(NClass nClass) Gets all the declared methods of the given class (regardless of their access modifiers, regardless of whether they override methods of the base classes.)getDeclaringClassForField
(Void aVoid) Gets the class that declares the given field.getDeclaringClassForMethod
(Void aVoid) Gets the class that declares the given method.Void[]
getEnumConstants
(NClass clazz) Gets the enumeration constants from an enum class.getFieldName
(Void aVoid) Gets the name of the field.getFieldType
(Void aVoid) Gets the type of the field.getMethodName
(Void aVoid) Gets the name of the method, such as "toString" or "equals".NType[]
getMethodParameters
(Void aVoid) Returns the list of parameters to the method.getPackageName
(NClass clazz) Gets the package name of the given class.getPrimitive
(Class primitiveType) Returns the representation for the given primitive type.getReturnType
(Void aVoid) Gets the return type of a method.getSuperClass
(NClass nClass) Gets the base class of the specified class.getTypeArgument
(NType nt, int i) Gets the i-th type argument from a parameterized type.getTypeName
(NType type) Gets the display name of the type objectGets the representation of the primitive "void" type.boolean
hasDefaultConstructor
(NClass nClass) Returns true if the given class has a no-arg default constructor.boolean
isAbstract
(NClass clazz) Returns true if this is an abstract class.boolean
Checks if the type is an array type.boolean
Checks if the type is an array type but not byte[].boolean
isBridgeMethod
(Void method) Returns true if this method is a bridge method as defined in JLS.boolean
Returns true if this is an enum class.boolean
Deprecated.no class generated by XJC is final.boolean
isFinalMethod
(Void aVoid) Returns true if the method is final.boolean
isInnerClass
(NClass clazz) Returns true if the given class is an inner class.boolean
isInterface
(NClass clazz) Returns true if 'clazz' is an interface.boolean
isOverriding
(Void method, NClass clazz) Returns true if the given method is overriding another one defined in the base class 'base' or its ancestors.boolean
Returns true if t is a parameterized type.boolean
isPrimitive
(NType type) Checks if the given type is a primitive type.boolean
isPublicField
(Void aVoid) Returns true if the field is public.boolean
isPublicMethod
(Void aVoid) Returns true if the method is public.boolean
isSameType
(NType t1, NType t2) Checks if types are the sameboolean
isStaticField
(Void aVoid) Returns true if the field is static.boolean
isStaticMethod
(Void aVoid) Returns true if the method is static.boolean
isSubClassOf
(NType sub, NType sup) Checks ifsub
is a sub-type ofsup
.boolean
isTransient
(Void f) Returns true if the field is transient.loadObjectFactory
(NClass referencePoint, String pkg) Finds ObjectFactory for the given referencePoint.Gets the representation of the given Java type inT
.Gets the T for the given C.
-
Field Details
-
theInstance
-
-
Method Details
-
getDeclaringClassForField
Description copied from interface:Navigator
Gets the class that declares the given field. -
getDeclaringClassForMethod
Description copied from interface:Navigator
Gets the class that declares the given method. -
getFieldType
Description copied from interface:Navigator
Gets the type of the field. -
getFieldName
Description copied from interface:Navigator
Gets the name of the field. -
getMethodName
Description copied from interface:Navigator
Gets the name of the method, such as "toString" or "equals". -
getReturnType
Description copied from interface:Navigator
Gets the return type of a method. -
getMethodParameters
Description copied from interface:Navigator
Returns the list of parameters to the method. -
isStaticMethod
Description copied from interface:Navigator
Returns true if the method is static. -
isFinalMethod
Description copied from interface:Navigator
Returns true if the method is final. -
ref
Description copied from interface:Navigator
Gets the representation of the given Java type inT
. -
ref
-
asDecl
Description copied from interface:Navigator
Gets theC
representation for the given class. The behavior is undefined if the class object represents primitives, arrays, and other types that are not class declaration. -
getPrimitive
Description copied from interface:Navigator
Returns the representation for the given primitive type.- Specified by:
getPrimitive
in interfaceNavigator<NType,
NClass, Void, Void> - Parameters:
primitiveType
- must be Class objects likeInteger.TYPE
.
-
create
-
create
-
getFieldLocation
-
getMethodLocation
-
isStaticField
Description copied from interface:Navigator
Returns true if the field is static. -
isPublicMethod
Description copied from interface:Navigator
Returns true if the method is public. -
isPublicField
Description copied from interface:Navigator
Returns true if the field is public. -
getVoidType
Description copied from interface:Navigator
Gets the representation of the primitive "void" type. -
isBridgeMethod
Description copied from interface:Navigator
Returns true if this method is a bridge method as defined in JLS. -
isTransient
Description copied from interface:Navigator
Returns true if the field is transient.