public class OXMJavaClassImpl extends java.lang.Object implements JavaClass
Purpose: JavaClass
implementation wrapping MOXy's xmlmodel.JavaType
.
Used when bootstrapping a DynamicJAXBContext
from XML Bindings.
Responsibilities:
JavaType
.Constructor and Description |
---|
OXMJavaClassImpl(JavaType aJavaType)
Construct a new instance of
OXMJavaClassImpl . |
OXMJavaClassImpl(java.lang.String aJavaTypeName)
Construct a new instance of
OXMJavaClassImpl . |
OXMJavaClassImpl(java.lang.String aJavaTypeName,
java.util.List<java.lang.String> enumValues)
Construct a new instance of
OXMJavaClassImpl
representing a Java enum . |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<JavaClass> |
getActualTypeArguments()
Return the "actual" type from a parameterized type.
|
JavaAnnotation |
getAnnotation(JavaClass aClass)
If this
JavaClass is annotated with an Annotation matching aClass ,
return its JavaAnnotation representation. |
java.util.Collection<JavaAnnotation> |
getAnnotations()
Return all of the
Annotations for this JavaClass . |
JavaClass |
getComponentType()
If this
JavaClass is an array type, return the type of the
array components. |
JavaConstructor |
getConstructor(JavaClass[] parameterTypes)
Return the
JavaConstructor for this JavaClass that has the
provided parameter types. |
java.util.Collection<JavaConstructor> |
getConstructors()
Return all of the
JavaConstructors for this JavaClass. |
JavaAnnotation |
getDeclaredAnnotation(JavaClass arg0)
If this
JavaClass declares an Annotation matching aClass ,
return its JavaAnnotation representation. |
java.util.Collection<JavaAnnotation> |
getDeclaredAnnotations()
Return all of the declared
Annotations for this JavaClass . |
java.util.Collection<JavaClass> |
getDeclaredClasses()
Return this
JavaClass' inner classes. |
JavaConstructor |
getDeclaredConstructor(JavaClass[] parameterTypes)
Return the declared
JavaConstructor for this JavaClass . |
java.util.Collection<JavaConstructor> |
getDeclaredConstructors()
Return all of the declared
JavaConstructors for this JavaClass . |
JavaField |
getDeclaredField(java.lang.String name)
Return the declared
JavaField for this JavaClass , identified
by fieldName . |
java.util.Collection<JavaField> |
getDeclaredFields()
Return all of the declared
JavaFields for this JavaClass . |
JavaMethod |
getDeclaredMethod(java.lang.String name,
JavaClass[] args)
Return the declared
JavaMethod for this JavaClass ,
identified by name , with the signature matching args . |
java.util.Collection<JavaMethod> |
getDeclaredMethods()
Return all of the declared
JavaMethods for this JavaClass . |
java.lang.reflect.Type[] |
getGenericInterfaces() |
java.lang.reflect.Type |
getGenericSuperclass() |
JavaModel |
getJavaModel()
Get this
JavaClass' JavaModel . |
JavaMethod |
getMethod(java.lang.String name,
JavaClass[] args)
Return the
JavaMethod for this JavaClass ,
identified by name , with the signature matching args . |
java.util.Collection<JavaMethod> |
getMethods()
Return all of the
JavaMethods for this JavaClass . |
int |
getModifiers()
Returns the Java language modifiers for this
JavaClass , encoded in an integer. |
java.lang.String |
getName()
Returns the name of this
JavaClass . |
JavaPackage |
getPackage()
Returns the
JavaPackage that this JavaClass belongs to. |
java.lang.String |
getPackageName()
Returns the package name of this
JavaClass . |
java.lang.String |
getQualifiedName()
Returns the fully-qualified name of this
JavaClass . |
java.lang.String |
getRawName()
Returns the raw name of this
JavaClass . |
JavaClass |
getSuperclass()
Returns the super class of this
JavaClass . |
boolean |
hasActualTypeArguments()
Indicates if this
JavaClass has actual type arguments, i.e. is a
parameterized type (for example, List<Employee ). |
JavaClassInstanceOf |
instanceOf() |
boolean |
isAbstract()
Indicates if this
JavaClass is abstract . |
boolean |
isAnnotation()
Indicates if this
JavaClass is an Annotation . |
boolean |
isArray()
Indicates if this
JavaClass is an Array type. |
boolean |
isAssignableFrom(JavaClass arg0)
Indicates if this
JavaClass is either the same as, or is a superclass of,
the javaClass argument. |
boolean |
isEnum()
Indicates if this
JavaClass is an enum . |
boolean |
isFinal()
Indicates if this
JavaClass is final . |
boolean |
isInterface()
Indicates if this
JavaClass is an interface . |
boolean |
isMemberClass()
Indicates if this
JavaClass is an inner Class . |
boolean |
isPrimitive()
Indicates if this
JavaClass represents a primitive type. |
boolean |
isPrivate()
Indicates if this
JavaClass is private . |
boolean |
isProtected()
Indicates if this
JavaClass is protected . |
boolean |
isPublic()
Indicates if this
JavaClass is public . |
boolean |
isStatic()
Indicates if this
JavaClass is static . |
boolean |
isSynthetic()
Not supported.
|
void |
setJavaModel(JavaModel model)
Set this
JavaClass' JavaModel . |
public OXMJavaClassImpl(JavaType aJavaType)
OXMJavaClassImpl
.aJavaType
- - the XJC JavaType
to be wrapped.public OXMJavaClassImpl(java.lang.String aJavaTypeName)
OXMJavaClassImpl
.aJavaTypeName
- - the name of the JavaType to create.public OXMJavaClassImpl(java.lang.String aJavaTypeName, java.util.List<java.lang.String> enumValues)
OXMJavaClassImpl
representing a Java enum
.aJavaTypeName
- - the name of the JavaType to create.enumValues
- - the list of values for this enum
.public java.util.Collection<JavaClass> getActualTypeArguments()
JavaClass
represents List<Employee
, this method will return the
Employee
JavaClass
.getActualTypeArguments
in interface JavaClass
Collection
containing the actual type's JavaClass
.public JavaClass getComponentType()
JavaClass
is an array type, return the type of the
array components.getComponentType
in interface JavaClass
null
, as JavaTypes
do not represent arrays.public JavaConstructor getConstructor(JavaClass[] parameterTypes)
JavaConstructor
for this JavaClass
that has the
provided parameter types.getConstructor
in interface JavaClass
parameterTypes
- the parameter list used to identify the constructor.JavaConstructor
with the signature matching parameterTypes.public java.util.Collection<JavaConstructor> getConstructors()
JavaConstructors
for this JavaClass.getConstructors
in interface JavaClass
Collection
containing this JavaClass'
JavaConstructors
.public java.util.Collection<JavaClass> getDeclaredClasses()
JavaClass'
inner classes.getDeclaredClasses
in interface JavaClass
ArrayList
as JavaTypes
do not represent inner classes.public JavaConstructor getDeclaredConstructor(JavaClass[] parameterTypes)
JavaConstructor
for this JavaClass
.getDeclaredConstructor
in interface JavaClass
JavaConstructor
for this JavaClass
.public java.util.Collection<JavaConstructor> getDeclaredConstructors()
JavaConstructors
for this JavaClass
.getDeclaredConstructors
in interface JavaClass
Collection
containing this JavaClass'
JavaConstructors
.public JavaField getDeclaredField(java.lang.String name)
JavaField
for this JavaClass
, identified
by fieldName
.getDeclaredField
in interface JavaClass
name
- the name of the JavaField
to return.JavaField
named fieldName
from this JavaClass
.public java.util.Collection<JavaField> getDeclaredFields()
JavaFields
for this JavaClass
.getDeclaredFields
in interface JavaClass
Collection
containing this JavaClass'
JavaFields
.public JavaMethod getDeclaredMethod(java.lang.String name, JavaClass[] args)
JavaMethod
for this JavaClass
,
identified by name
, with the signature matching args
.getDeclaredMethod
in interface JavaClass
name
- the name of the JavaMethod
to return.args
- the parameter list used to identify the method.null
, as JavaTypes
do not have methods.public java.util.Collection<JavaMethod> getDeclaredMethods()
JavaMethods
for this JavaClass
.getDeclaredMethods
in interface JavaClass
ArrayList
, as JavaTypes
do not have methods.public JavaMethod getMethod(java.lang.String name, JavaClass[] args)
JavaMethod
for this JavaClass
,
identified by name
, with the signature matching args
.public java.util.Collection<JavaMethod> getMethods()
JavaMethods
for this JavaClass
.getMethods
in interface JavaClass
ArrayList
, as JavaTypes
do not have methods.public int getModifiers()
JavaClass
, encoded in an integer.getModifiers
in interface JavaClass
0
as JavaTypes
do not have modifiers.Modifier
public java.lang.String getName()
JavaClass
.public JavaPackage getPackage()
JavaPackage
that this JavaClass
belongs to.getPackage
in interface JavaClass
JavaPackage
of this JavaClass
.public java.lang.String getPackageName()
JavaClass
.getPackageName
in interface JavaClass
String
name of this JavaClass'
JavaPackage
.public java.lang.String getQualifiedName()
JavaClass
.getQualifiedName
in interface JavaClass
String
name of this JavaClass
.public java.lang.String getRawName()
JavaClass
. Array types will
have "[]" appended to the name.getRawName
in interface JavaClass
String
raw name of this JavaClass
.public JavaClass getSuperclass()
JavaClass
.getSuperclass
in interface JavaClass
JavaClass
representing the super class of this JavaClass
.public java.lang.reflect.Type[] getGenericInterfaces()
getGenericInterfaces
in interface JavaClass
public java.lang.reflect.Type getGenericSuperclass()
getGenericSuperclass
in interface JavaClass
public boolean hasActualTypeArguments()
JavaClass
has actual type arguments, i.e. is a
parameterized type (for example, List<Employee
).hasActualTypeArguments
in interface JavaClass
false
as JavaTypes
are not parameterized.public boolean isAbstract()
JavaClass
is abstract
.isAbstract
in interface JavaClass
false
as JavaTypes
are never abstract
.public boolean isAnnotation()
JavaClass
is an Annotation
.isAnnotation
in interface JavaClass
false
as JavaTypes
are never Annotations
.public boolean isArray()
JavaClass
is an Array type.public boolean isAssignableFrom(JavaClass arg0)
JavaClass
is either the same as, or is a superclass of,
the javaClass
argument.isAssignableFrom
in interface JavaClass
arg0
- the Class
to test.true
if this JavaClass
is assignable from
javaClass
, otherwise false
.Class.isAssignableFrom(Class)
public boolean isEnum()
JavaClass
is an enum
.public boolean isFinal()
JavaClass
is final
.public boolean isInterface()
JavaClass
is an interface
.isInterface
in interface JavaClass
true
if this JavaClass
is an interface
, otherwise false
.public boolean isMemberClass()
JavaClass
is an inner Class
.isMemberClass
in interface JavaClass
true
if this JavaClass
is an inner Class
, otherwise false
.public boolean isPrimitive()
JavaClass
represents a primitive type.isPrimitive
in interface JavaClass
true
if this JavaClass
represents a primitive type, otherwise false
.public boolean isPrivate()
JavaClass
is private
.public boolean isProtected()
JavaClass
is protected
.isProtected
in interface JavaClass
true
if this JavaClass
is protected
, otherwise false
.public boolean isPublic()
JavaClass
is public
.public boolean isStatic()
JavaClass
is static
.public boolean isSynthetic()
isSynthetic
in interface JavaClass
public JavaClassInstanceOf instanceOf()
instanceOf
in interface JavaClass
public JavaAnnotation getAnnotation(JavaClass aClass)
JavaClass
is annotated with an Annotation
matching aClass
,
return its JavaAnnotation
representation.getAnnotation
in interface JavaHasAnnotations
aClass
- a JavaClass
representing the Annotation
to look for.null
, as JavaTypes
do not have Annotations
.public java.util.Collection<JavaAnnotation> getAnnotations()
Annotations
for this JavaClass
.getAnnotations
in interface JavaHasAnnotations
ArrayList
, as JavaTypes
do not have Annotations
.public JavaAnnotation getDeclaredAnnotation(JavaClass arg0)
JavaClass
declares an Annotation
matching aClass
,
return its JavaAnnotation
representation.getDeclaredAnnotation
in interface JavaHasAnnotations
arg0
- a JavaClass
representing the Annotation
to look for.null
, as JavaTypes
do not have Annotations
.public java.util.Collection<JavaAnnotation> getDeclaredAnnotations()
Annotations
for this JavaClass
.getDeclaredAnnotations
in interface JavaHasAnnotations
ArrayList
, as JavaTypes
do not have Annotations
.public void setJavaModel(JavaModel model)
JavaClass'
JavaModel
.model
- The JavaModel
to set.public JavaModel getJavaModel()
JavaClass'
JavaModel
.JavaModel
associated with this JavaClass
.