Module org.eclipse.persistence.moxy
Class OXMJavaClassImpl
java.lang.Object
org.eclipse.persistence.jaxb.javamodel.oxm.OXMJavaClassImpl
- All Implemented Interfaces:
JavaClass
,JavaHasAnnotations
INTERNAL:
Purpose: JavaClass
implementation wrapping MOXy's xmlmodel.JavaType
.
Used when bootstrapping a DynamicJAXBContext
from XML Bindings.
Responsibilities:
- Provide Class information from the underlying
JavaType
.
- Since:
- EclipseLink 2.2
- See Also:
-
Constructor Summary
ConstructorDescriptionOXMJavaClassImpl
(String aJavaTypeName) Construct a new instance ofOXMJavaClassImpl
.OXMJavaClassImpl
(String aJavaTypeName, List<String> enumValues) Construct a new instance ofOXMJavaClassImpl
representing a Javaenum
.OXMJavaClassImpl
(JavaType aJavaType) Construct a new instance ofOXMJavaClassImpl
. -
Method Summary
Modifier and TypeMethodDescriptionReturn the "actual" type from a parameterized type.getAnnotation
(JavaClass aClass) If thisJavaClass
is annotated with anAnnotation
matchingaClass
, return itsJavaAnnotation
representation.Return all of theAnnotations
for thisJavaClass
.If thisJavaClass
is an array type, return the type of the array components.getConstructor
(JavaClass[] parameterTypes) Return theJavaConstructor
for thisJavaClass
that has the provided parameter types.Return all of theJavaConstructors
for this JavaClass.If thisJavaClass
declares anAnnotation
matchingaClass
, return itsJavaAnnotation
representation.Return all of the declaredAnnotations
for thisJavaClass
.Return thisJavaClass'
inner classes.getDeclaredConstructor
(JavaClass[] parameterTypes) Return the declaredJavaConstructor
for thisJavaClass
.Return all of the declaredJavaConstructors
for thisJavaClass
.getDeclaredField
(String name) Return the declaredJavaField
for thisJavaClass
, identified byfieldName
.Return all of the declaredJavaFields
for thisJavaClass
.getDeclaredMethod
(String name, JavaClass[] args) Return the declaredJavaMethod
for thisJavaClass
, identified byname
, with the signature matchingargs
.Return all of the declaredJavaMethods
for thisJavaClass
.Type[]
Get thisJavaClass'
JavaModel
.Return theJavaMethod
for thisJavaClass
, identified byname
, with the signature matchingargs
.Return all of theJavaMethods
for thisJavaClass
.int
Returns the Java language modifiers for thisJavaClass
, encoded in an integer.getName()
Returns the name of thisJavaClass
.Returns theJavaPackage
that thisJavaClass
belongs to.Returns the package name of thisJavaClass
.Returns the fully-qualified name of thisJavaClass
.Returns the raw name of thisJavaClass
.Returns the super class of thisJavaClass
.boolean
Indicates if thisJavaClass
has actual type arguments, i.e.boolean
Indicates if thisJavaClass
isabstract
.boolean
Indicates if thisJavaClass
is anAnnotation
.boolean
isArray()
Indicates if thisJavaClass
is an Array type.boolean
isAssignableFrom
(JavaClass arg0) Indicates if thisJavaClass
is either the same as, or is a superclass of, thejavaClass
argument.boolean
isEnum()
Indicates if thisJavaClass
is anenum
.boolean
isFinal()
Indicates if thisJavaClass
isfinal
.boolean
Indicates if thisJavaClass
is aninterface
.boolean
Indicates if thisJavaClass
is an innerClass
.boolean
Indicates if thisJavaClass
represents a primitive type.boolean
Indicates if thisJavaClass
isprivate
.boolean
Indicates if thisJavaClass
isprotected
.boolean
isPublic()
Indicates if thisJavaClass
ispublic
.boolean
isStatic()
Indicates if thisJavaClass
isstatic
.boolean
Not supported.void
setJavaModel
(JavaModel model) Set thisJavaClass'
JavaModel
.
-
Constructor Details
-
OXMJavaClassImpl
Construct a new instance ofOXMJavaClassImpl
.- Parameters:
aJavaType
- - the XJCJavaType
to be wrapped.
-
OXMJavaClassImpl
Construct a new instance ofOXMJavaClassImpl
.- Parameters:
aJavaTypeName
- - the name of the JavaType to create.
-
OXMJavaClassImpl
Construct a new instance ofOXMJavaClassImpl
representing a Javaenum
.- Parameters:
aJavaTypeName
- - the name of the JavaType to create.enumValues
- - the list of values for thisenum
.
-
-
Method Details
-
getActualTypeArguments
Return the "actual" type from a parameterized type. For example, if thisJavaClass
representsList<Employee
, this method will return theEmployee
JavaClass
.- Specified by:
getActualTypeArguments
in interfaceJavaClass
- Returns:
- a
Collection
containing the actual type'sJavaClass
.
-
getComponentType
If thisJavaClass
is an array type, return the type of the array components.- Specified by:
getComponentType
in interfaceJavaClass
- Returns:
- always returns
null
, asJavaTypes
do not represent arrays.
-
getConstructor
Return theJavaConstructor
for thisJavaClass
that has the provided parameter types.- Specified by:
getConstructor
in interfaceJavaClass
- Parameters:
parameterTypes
- the parameter list used to identify the constructor.- Returns:
- the
JavaConstructor
with the signature matching parameterTypes.
-
getConstructors
Return all of theJavaConstructors
for this JavaClass.- Specified by:
getConstructors
in interfaceJavaClass
- Returns:
- A
Collection
containing thisJavaClass'
JavaConstructors
.
-
getDeclaredClasses
Return thisJavaClass'
inner classes.- Specified by:
getDeclaredClasses
in interfaceJavaClass
- Returns:
- always returns an empty
ArrayList
asJavaTypes
do not represent inner classes.
-
getDeclaredConstructor
Return the declaredJavaConstructor
for thisJavaClass
.- Specified by:
getDeclaredConstructor
in interfaceJavaClass
- Returns:
- the
JavaConstructor
for thisJavaClass
.
-
getDeclaredConstructors
Return all of the declaredJavaConstructors
for thisJavaClass
.- Specified by:
getDeclaredConstructors
in interfaceJavaClass
- Returns:
- A
Collection
containing thisJavaClass'
JavaConstructors
.
-
getDeclaredField
Return the declaredJavaField
for thisJavaClass
, identified byfieldName
.- Specified by:
getDeclaredField
in interfaceJavaClass
- Parameters:
name
- the name of theJavaField
to return.- Returns:
- the
JavaField
namedfieldName
from thisJavaClass
.
-
getDeclaredFields
Return all of the declaredJavaFields
for thisJavaClass
.- Specified by:
getDeclaredFields
in interfaceJavaClass
- Returns:
- A
Collection
containing thisJavaClass'
JavaFields
.
-
getDeclaredMethod
Return the declaredJavaMethod
for thisJavaClass
, identified byname
, with the signature matchingargs
.- Specified by:
getDeclaredMethod
in interfaceJavaClass
- Parameters:
name
- the name of theJavaMethod
to return.args
- the parameter list used to identify the method.- Returns:
- always returns
null
, asJavaTypes
do not have methods.
-
getDeclaredMethods
Return all of the declaredJavaMethods
for thisJavaClass
.- Specified by:
getDeclaredMethods
in interfaceJavaClass
- Returns:
- always returns an empty
ArrayList
, asJavaTypes
do not have methods.
-
getMethod
Return theJavaMethod
for thisJavaClass
, identified byname
, with the signature matchingargs
. -
getMethods
Return all of theJavaMethods
for thisJavaClass
.- Specified by:
getMethods
in interfaceJavaClass
- Returns:
- always returns an empty
ArrayList
, asJavaTypes
do not have methods.
-
getModifiers
public int getModifiers()Returns the Java language modifiers for thisJavaClass
, encoded in an integer.- Specified by:
getModifiers
in interfaceJavaClass
- Returns:
- always returns
0
asJavaTypes
do not have modifiers. - See Also:
-
getName
Returns the name of thisJavaClass
. -
getPackage
Returns theJavaPackage
that thisJavaClass
belongs to.- Specified by:
getPackage
in interfaceJavaClass
- Returns:
- the
JavaPackage
of thisJavaClass
.
-
getPackageName
Returns the package name of thisJavaClass
.- Specified by:
getPackageName
in interfaceJavaClass
- Returns:
- the
String
name of thisJavaClass'
JavaPackage
.
-
getQualifiedName
Returns the fully-qualified name of thisJavaClass
.- Specified by:
getQualifiedName
in interfaceJavaClass
- Returns:
- the
String
name of thisJavaClass
.
-
getRawName
Returns the raw name of thisJavaClass
. Array types will have "[]" appended to the name.- Specified by:
getRawName
in interfaceJavaClass
- Returns:
- the
String
raw name of thisJavaClass
.
-
getSuperclass
Returns the super class of thisJavaClass
.- Specified by:
getSuperclass
in interfaceJavaClass
- Returns:
JavaClass
representing the super class of thisJavaClass
.
-
getGenericInterfaces
- Specified by:
getGenericInterfaces
in interfaceJavaClass
-
getGenericSuperclass
- Specified by:
getGenericSuperclass
in interfaceJavaClass
-
hasActualTypeArguments
public boolean hasActualTypeArguments()Indicates if thisJavaClass
has actual type arguments, i.e. is a parameterized type (for example,List<Employee
).- Specified by:
hasActualTypeArguments
in interfaceJavaClass
- Returns:
- always returns
false
asJavaTypes
are not parameterized.
-
isAbstract
public boolean isAbstract()Indicates if thisJavaClass
isabstract
.- Specified by:
isAbstract
in interfaceJavaClass
- Returns:
- always returns
false
asJavaTypes
are neverabstract
.
-
isAnnotation
public boolean isAnnotation()Indicates if thisJavaClass
is anAnnotation
.- Specified by:
isAnnotation
in interfaceJavaClass
- Returns:
- always returns
false
asJavaTypes
are neverAnnotations
.
-
isArray
public boolean isArray()Indicates if thisJavaClass
is an Array type. -
isAssignableFrom
Indicates if thisJavaClass
is either the same as, or is a superclass of, thejavaClass
argument.- Specified by:
isAssignableFrom
in interfaceJavaClass
- Parameters:
arg0
- theClass
to test.- Returns:
true
if thisJavaClass
is assignable fromjavaClass
, otherwisefalse
.- See Also:
-
isEnum
public boolean isEnum()Indicates if thisJavaClass
is anenum
. -
isFinal
public boolean isFinal()Indicates if thisJavaClass
isfinal
. -
isInterface
public boolean isInterface()Indicates if thisJavaClass
is aninterface
.- Specified by:
isInterface
in interfaceJavaClass
- Returns:
true
if thisJavaClass
is aninterface
, otherwisefalse
.
-
isMemberClass
public boolean isMemberClass()Indicates if thisJavaClass
is an innerClass
.- Specified by:
isMemberClass
in interfaceJavaClass
- Returns:
true
if thisJavaClass
is an innerClass
, otherwisefalse
.
-
isPrimitive
public boolean isPrimitive()Indicates if thisJavaClass
represents a primitive type.- Specified by:
isPrimitive
in interfaceJavaClass
- Returns:
true
if thisJavaClass
represents a primitive type, otherwisefalse
.
-
isPrivate
public boolean isPrivate()Indicates if thisJavaClass
isprivate
. -
isProtected
public boolean isProtected()Indicates if thisJavaClass
isprotected
.- Specified by:
isProtected
in interfaceJavaClass
- Returns:
true
if thisJavaClass
isprotected
, otherwisefalse
.
-
isPublic
public boolean isPublic()Indicates if thisJavaClass
ispublic
. -
isStatic
public boolean isStatic()Indicates if thisJavaClass
isstatic
. -
isSynthetic
public boolean isSynthetic()Not supported.- Specified by:
isSynthetic
in interfaceJavaClass
-
instanceOf
- Specified by:
instanceOf
in interfaceJavaClass
-
getAnnotation
If thisJavaClass
is annotated with anAnnotation
matchingaClass
, return itsJavaAnnotation
representation.- Specified by:
getAnnotation
in interfaceJavaHasAnnotations
- Parameters:
aClass
- aJavaClass
representing theAnnotation
to look for.- Returns:
- always returns
null
, asJavaTypes
do not haveAnnotations
.
-
getAnnotations
Return all of theAnnotations
for thisJavaClass
.- Specified by:
getAnnotations
in interfaceJavaHasAnnotations
- Returns:
- always returns an empty
ArrayList
, asJavaTypes
do not haveAnnotations
.
-
getDeclaredAnnotation
If thisJavaClass
declares anAnnotation
matchingaClass
, return itsJavaAnnotation
representation.- Specified by:
getDeclaredAnnotation
in interfaceJavaHasAnnotations
- Parameters:
arg0
- aJavaClass
representing theAnnotation
to look for.- Returns:
- always returns
null
, asJavaTypes
do not haveAnnotations
.
-
getDeclaredAnnotations
Return all of the declaredAnnotations
for thisJavaClass
.- Specified by:
getDeclaredAnnotations
in interfaceJavaHasAnnotations
- Returns:
- always returns an empty
ArrayList
, asJavaTypes
do not haveAnnotations
.
-
setJavaModel
Set thisJavaClass'
JavaModel
.- Parameters:
model
- TheJavaModel
to set.
-
getJavaModel
Get thisJavaClass'
JavaModel
.- Returns:
- The
JavaModel
associated with thisJavaClass
.
-