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.
| Modifier and Type | Field and Description |
|---|---|
| public static final NavigatorImpl |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public NClass | asDecl(NType nt)
Implements org. If the given type is an use of class declaration,
returns the type casted as |
| public NClass | asDecl(Class<T> c)
Implements org. Gets the |
| public static NType | |
| public static NClass | |
| public static NType | createParameterizedType(NClass rawType, NType... args)
Creates a |
| public static NType | |
| public <T> NType | erasure(NType type)
Implements org. Computes the erasure |
| public NType | getBaseClass(NType nt, NClass base)
Implements org. Gets the parameterization of the given base type. |
| public Location | getClassLocation(final NClass c)
Implements org. Returns a location of the specified class. |
| public String | getClassName(NClass nClass)
Implements org. Gets the fully-qualified name of the class. |
| public String | getClassShortName(NClass nClass)
Implements org. Gets the short name of the class ("Object" for |
| public NType | getComponentType(NType nType)
Implements org. Gets the component type of the array. |
| public Void | getDeclaredField(NClass clazz, String fieldName)
Implements org. Gets the named field declared on the given class. |
| public Collection | getDeclaredFields(NClass nClass)
Implements org. Gets all the declared fields of the given class. |
| public Collection | getDeclaredMethods(NClass nClass)
Implements 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. |
| public NClass | getDeclaringClassForField(Void aVoid)
Implements org. Gets the class that declares the given field. |
| public NClass | getDeclaringClassForMethod(Void aVoid)
Implements org. Gets the class that declares the given method. |
| public Void[] | getEnumConstants(NClass clazz)
Implements org. Gets the enumeration constants from an enum class. |
| public Location | |
| public String | getFieldName(Void aVoid)
Implements org. Gets the name of the field. |
| public NType | getFieldType(Void aVoid)
Implements org. Gets the type of the field. |
| public Location | |
| public String | getMethodName(Void aVoid)
Implements org. Gets the name of the method, such as "toString" or "equals". |
| public NType[] | getMethodParameters(Void aVoid)
Implements org. Returns the list of parameters to the method. |
| public String | getPackageName(NClass clazz)
Implements org. Gets the package name of the given class. |
| public NType | getPrimitive(Class<T> primitiveType)
Implements org. Returns the representation for the given primitive type. |
| public NType | getReturnType(Void aVoid)
Implements org. Gets the return type of a method. |
| public NClass | getSuperClass(NClass nClass)
Implements org. Gets the base class of the specified class. |
| public NType | getTypeArgument(NType nt, int i)
Implements org. Gets the i-th type argument from a parameterized type. |
| public String | getTypeName(NType type)
Implements org. Gets the display name of the type object |
| public NType | getVoidType()
Implements org. Gets the representation of the primitive "void" type. |
| public boolean | hasDefaultConstructor(NClass nClass)
Implements org. Returns true if the given class has a no-arg default constructor. |
| public boolean | isAbstract(NClass clazz)
Implements org. Returns true if this is an abstract class. |
| public boolean | isArray(NType nType)
Implements org. Checks if the type is an array type. |
| public boolean | isArrayButNotByteArray(NType t)
Implements org. Checks if the type is an array type but not byte[]. |
| public boolean | isBridgeMethod(Void method)
Implements org. Returns true if this method is a bridge method as defined in JLS. |
| public boolean | isEnum(NClass c)
Implements org. Returns true if this is an enum class. |
| public boolean | isFinal(NClass clazz)
Implements org.
Deprecated
no class generated by XJC is final.
Returns true if this is a final class. |
| public boolean | isFinalMethod(Void aVoid)
Implements org. Returns true if the method is final. |
| public boolean | isInnerClass(NClass clazz)
Implements org. Returns true if the given class is an inner class. |
| public boolean | isInterface(NClass clazz)
Implements org. Returns true if 'clazz' is an interface. |
| public boolean | isOverriding(Void method, NClass clazz)
Implements org. Returns true if the given method is overriding another one defined in the base class 'base' or its ancestors. |
| public boolean | isParameterizedType(NType nt)
Implements org. Returns true if t is a parameterized type. |
| public boolean | isPrimitive(NType type)
Implements org. Checks if the given type is a primitive type. |
| public boolean | isPublicField(Void aVoid)
Implements org. Returns true if the field is public. |
| public boolean | isPublicMethod(Void aVoid)
Implements org. Returns true if the method is public. |
| public boolean | isSameType(NType t1, NType t2)
Implements org. Checks if types are the same |
| public boolean | isStaticField(Void aVoid)
Implements org. Returns true if the field is static. |
| public boolean | isStaticMethod(Void aVoid)
Implements org. Returns true if the method is static. |
| public boolean | isSubClassOf(NType sub, NType sup)
Implements org. Checks if |
| public boolean | isTransient(Void f)
Implements org. Returns true if the field is transient. |
| public NClass | loadObjectFactory(NClass referencePoint, String pkg)
Implements org. Finds ObjectFactory for the given referencePoint. |
| public NClass | ref(Class<T> c)
Implements org. Gets the representation of the given Java type in |
| public NClass | |
| public NType | use(NClass nc)
Implements org. Gets the T for the given C. |
| theInstance | back to summary |
|---|---|
| public static final NavigatorImpl theInstance | |
| NavigatorImpl | back to summary |
|---|---|
| private NavigatorImpl() | |
| asDecl | back to summary |
|---|---|
| public NClass asDecl(NType nt) 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 NClass asDecl(Class<T> c) Implements org. Doc from org. Gets the
| |
| create | back to summary |
|---|---|
| public static NType create(Type t) | |
| create | back to summary |
|---|---|
| public static NClass create(Class<T> c) | |
| createParameterizedType | back to summary |
|---|---|
| public static NType createParameterizedType(NClass rawType, NType... args) Creates a | |
| createParameterizedType | back to summary |
|---|---|
| public static NType createParameterizedType(Class<T> rawType, NType... args) | |
| erasure | back to summary |
|---|---|
| public <T> NType erasure(NType type) Implements org. Doc from org. Computes the erasure
| |
| getBaseClass | back to summary |
|---|---|
| public NType getBaseClass(NType nt, NClass base) 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(final NClass c) Implements org. Doc from org. Returns a location of the specified class.
| |
| getClassName | back to summary |
|---|---|
| public String getClassName(NClass nClass) Implements org. Doc from org. Gets the fully-qualified name of the class.
("java.lang.Object" for
| |
| getClassShortName | back to summary |
|---|---|
| public String getClassShortName(NClass nClass) Implements org. Doc from org. Gets the short name of the class ("Object" for
| |
| getComponentType | back to summary |
|---|---|
| public NType getComponentType(NType nType) Implements org. Doc from org. Gets the component type of the array.
| |
| getDeclaredField | back to summary |
|---|---|
| public Void getDeclaredField(NClass 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 NClass getDeclaringClassForField(Void aVoid) Implements org. Doc from org. Gets the class that declares the given field.
| |
| getDeclaringClassForMethod | back to summary |
|---|---|
| public NClass getDeclaringClassForMethod(Void aVoid) Implements org. Doc from org. Gets the class that declares the given method.
| |
| getEnumConstants | back to summary |
|---|---|
| public Void[] getEnumConstants(NClass clazz) Implements org. Doc from org. Gets the enumeration constants from an enum class.
| |
| getFieldLocation | back to summary |
|---|---|
| public Location getFieldLocation(Void v) Implements org.
| |
| getFieldName | back to summary |
|---|---|
| public String getFieldName(Void aVoid) Implements org. Doc from org. Gets the name of the field.
| |
| getFieldType | back to summary |
|---|---|
| public NType getFieldType(Void aVoid) Implements org. Doc from org. Gets the type of the field.
| |
| getMethodLocation | back to summary |
|---|---|
| public Location getMethodLocation(Void v) Implements org.
| |
| getMethodName | back to summary |
|---|---|
| public String getMethodName(Void aVoid) Implements org. Doc from org. Gets the name of the method, such as "toString" or "equals".
| |
| getMethodParameters | back to summary |
|---|---|
| public NType[] getMethodParameters(Void aVoid) Implements org. Doc from org. Returns the list of parameters to the method.
| |
| getPackageName | back to summary |
|---|---|
| public String getPackageName(NClass clazz) Implements org. Doc from org. Gets the package name of the given class.
| |
| getPrimitive | back to summary |
|---|---|
| public NType getPrimitive(Class<T> primitiveType) Implements org. Doc from org. Returns the representation for the given primitive type.
| |
| getReturnType | back to summary |
|---|---|
| public NType getReturnType(Void aVoid) Implements org. Doc from org. Gets the return type of a method.
| |
| getSuperClass | back to summary |
|---|---|
| public NClass getSuperClass(NClass nClass) Implements org. Doc from org. Gets the base class of the specified class.
| |
| getTypeArgument | back to summary |
|---|---|
| public NType getTypeArgument(NType nt, 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(NType type) Implements org. Doc from org. Gets the display name of the type object
| |
| getVoidType | back to summary |
|---|---|
| public NType getVoidType() Implements org. Doc from org. Gets the representation of the primitive "void" type.
| |
| hasDefaultConstructor | back to summary |
|---|---|
| public boolean hasDefaultConstructor(NClass nClass) 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.
| |
| isAbstract | back to summary |
|---|---|
| public boolean isAbstract(NClass clazz) Implements org. Doc from org. Returns true if this is an abstract class.
| |
| isArray | back to summary |
|---|---|
| public boolean isArray(NType nType) Implements org. Doc from org. Checks if the type is an array type.
| |
| isArrayButNotByteArray | back to summary |
|---|---|
| public boolean isArrayButNotByteArray(NType t) Implements org. Doc from org. Checks if the type is an array type but not byte[].
| |
| isBridgeMethod | back to summary |
|---|---|
| public boolean isBridgeMethod(Void 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(NClass c) Implements org. Doc from org. Returns true if this is an enum class.
| |
| isFinal | back to summary |
|---|---|
| public boolean isFinal(NClass clazz) Implements org. Doc from org. Deprecated no class generated by XJC is final. Returns true if this is a final class.
| |
| isFinalMethod | back to summary |
|---|---|
| public boolean isFinalMethod(Void aVoid) Implements org. Doc from org. Returns true if the method is final.
| |
| isInnerClass | back to summary |
|---|---|
| public boolean isInnerClass(NClass 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(NClass clazz) Implements org. Doc from org. Returns true if 'clazz' is an interface.
| |
| isOverriding | back to summary |
|---|---|
| public boolean isOverriding(Void method, NClass clazz) 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(NType nt) Implements org. Doc from org. Returns true if t is a parameterized type.
| |
| isPrimitive | back to summary |
|---|---|
| public boolean isPrimitive(NType type) Implements org. Doc from org. Checks if the given type is a primitive type.
| |
| isPublicField | back to summary |
|---|---|
| public boolean isPublicField(Void aVoid) Implements org. Doc from org. Returns true if the field is public.
| |
| isPublicMethod | back to summary |
|---|---|
| public boolean isPublicMethod(Void aVoid) Implements org. Doc from org. Returns true if the method is public.
| |
| isSameType | back to summary |
|---|---|
| public boolean isSameType(NType t1, NType t2) Implements org. Doc from org. Checks if types are the same
| |
| isStaticField | back to summary |
|---|---|
| public boolean isStaticField(Void aVoid) Implements org. Doc from org. Returns true if the field is static.
| |
| isStaticMethod | back to summary |
|---|---|
| public boolean isStaticMethod(Void aVoid) Implements org. Doc from org. Returns true if the method is static.
| |
| isSubClassOf | back to summary |
|---|---|
| public boolean isSubClassOf(NType sub, NType sup) Implements org. Doc from org. Checks if Todo should this method take T or C?
| |
| isTransient | back to summary |
|---|---|
| public boolean isTransient(Void f) Implements org. Doc from org. Returns true if the field is transient.
| |
| loadObjectFactory | back to summary |
|---|---|
| public NClass loadObjectFactory(NClass referencePoint, String pkg) Implements org. Doc from org. Finds ObjectFactory for the given referencePoint.
| |
| ref | back to summary |
|---|---|
| public NClass ref(Class<T> c) Implements org. Doc from org. Gets the representation of the given Java type in
| |
| ref | back to summary |
|---|---|
| public NClass ref(JClass c) | |
| use | back to summary |
|---|---|
| public NType use(NClass nc) Implements org. Doc from org. Gets the T for the given C.
| |