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.
-
Constructor Summary
ConstructorsConstructorDescriptionOXMJavaClassImpl(String aJavaTypeName) Construct a new instance ofOXMJavaClassImpl.OXMJavaClassImpl(String aJavaTypeName, List<String> enumValues) Construct a new instance ofOXMJavaClassImplrepresenting 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 thisJavaClassis annotated with anAnnotationmatchingaClass, return itsJavaAnnotationrepresentation.Return all of theAnnotationsfor thisJavaClass.If thisJavaClassis an array type, return the type of the array components.getConstructor(JavaClass[] parameterTypes) Return theJavaConstructorfor thisJavaClassthat has the provided parameter types.Return all of theJavaConstructorsfor this JavaClass.If thisJavaClassdeclares anAnnotationmatchingaClass, return itsJavaAnnotationrepresentation.Return all of the declaredAnnotationsfor thisJavaClass.Return thisJavaClass'inner classes.getDeclaredConstructor(JavaClass[] parameterTypes) Return the declaredJavaConstructorfor thisJavaClass.Return all of the declaredJavaConstructorsfor thisJavaClass.getDeclaredField(String name) Return the declaredJavaFieldfor thisJavaClass, identified byfieldName.Return all of the declaredJavaFieldsfor thisJavaClass.getDeclaredMethod(String name, JavaClass[] args) Return the declaredJavaMethodfor thisJavaClass, identified byname, with the signature matchingargs.Return all of the declaredJavaMethodsfor thisJavaClass.Type[]Get thisJavaClass'JavaModel.Return theJavaMethodfor thisJavaClass, identified byname, with the signature matchingargs.Return all of theJavaMethodsfor thisJavaClass.intReturns the Java language modifiers for thisJavaClass, encoded in an integer.getName()Returns the name of thisJavaClass.Returns theJavaPackagethat thisJavaClassbelongs 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.booleanIndicates if thisJavaClasshas actual type arguments, i.e.booleanIndicates if thisJavaClassisabstract.booleanIndicates if thisJavaClassis anAnnotation.booleanisArray()Indicates if thisJavaClassis an Array type.booleanisAssignableFrom(JavaClass arg0) Indicates if thisJavaClassis either the same as, or is a superclass of, thejavaClassargument.booleanisEnum()Indicates if thisJavaClassis anenum.booleanisFinal()Indicates if thisJavaClassisfinal.booleanIndicates if thisJavaClassis aninterface.booleanIndicates if thisJavaClassis an innerClass.booleanIndicates if thisJavaClassrepresents a primitive type.booleanIndicates if thisJavaClassisprivate.booleanIndicates if thisJavaClassisprotected.booleanisPublic()Indicates if thisJavaClassispublic.booleanisStatic()Indicates if thisJavaClassisstatic.booleanNot supported.voidsetJavaModel(JavaModel model) Set thisJavaClass'JavaModel.
-
Constructor Details
-
OXMJavaClassImpl
Construct a new instance ofOXMJavaClassImpl.- Parameters:
aJavaType- - the XJCJavaTypeto be wrapped.
-
OXMJavaClassImpl
Construct a new instance ofOXMJavaClassImpl.- Parameters:
aJavaTypeName- - the name of the JavaType to create.
-
OXMJavaClassImpl
Construct a new instance ofOXMJavaClassImplrepresenting 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 thisJavaClassrepresentsList<Employee, this method will return theEmployeeJavaClass.- Specified by:
getActualTypeArgumentsin interfaceJavaClass- Returns:
- a
Collectioncontaining the actual type'sJavaClass.
-
getComponentType
If thisJavaClassis an array type, return the type of the array components.- Specified by:
getComponentTypein interfaceJavaClass- Returns:
- always returns
null, asJavaTypesdo not represent arrays.
-
getConstructor
Return theJavaConstructorfor thisJavaClassthat has the provided parameter types.- Specified by:
getConstructorin interfaceJavaClass- Parameters:
parameterTypes- the parameter list used to identify the constructor.- Returns:
- the
JavaConstructorwith the signature matching parameterTypes.
-
getConstructors
Return all of theJavaConstructorsfor this JavaClass.- Specified by:
getConstructorsin interfaceJavaClass- Returns:
- A
Collectioncontaining thisJavaClass'JavaConstructors.
-
getDeclaredClasses
Return thisJavaClass'inner classes.- Specified by:
getDeclaredClassesin interfaceJavaClass- Returns:
- always returns an empty
ArrayListasJavaTypesdo not represent inner classes.
-
getDeclaredConstructor
Return the declaredJavaConstructorfor thisJavaClass.- Specified by:
getDeclaredConstructorin interfaceJavaClass- Returns:
- the
JavaConstructorfor thisJavaClass.
-
getDeclaredConstructors
Return all of the declaredJavaConstructorsfor thisJavaClass.- Specified by:
getDeclaredConstructorsin interfaceJavaClass- Returns:
- A
Collectioncontaining thisJavaClass'JavaConstructors.
-
getDeclaredField
Return the declaredJavaFieldfor thisJavaClass, identified byfieldName.- Specified by:
getDeclaredFieldin interfaceJavaClass- Parameters:
name- the name of theJavaFieldto return.- Returns:
- the
JavaFieldnamedfieldNamefrom thisJavaClass.
-
getDeclaredFields
Return all of the declaredJavaFieldsfor thisJavaClass.- Specified by:
getDeclaredFieldsin interfaceJavaClass- Returns:
- A
Collectioncontaining thisJavaClass'JavaFields.
-
getDeclaredMethod
Return the declaredJavaMethodfor thisJavaClass, identified byname, with the signature matchingargs.- Specified by:
getDeclaredMethodin interfaceJavaClass- Parameters:
name- the name of theJavaMethodto return.args- the parameter list used to identify the method.- Returns:
- always returns
null, asJavaTypesdo not have methods.
-
getDeclaredMethods
Return all of the declaredJavaMethodsfor thisJavaClass.- Specified by:
getDeclaredMethodsin interfaceJavaClass- Returns:
- always returns an empty
ArrayList, asJavaTypesdo not have methods.
-
getMethod
Return theJavaMethodfor thisJavaClass, identified byname, with the signature matchingargs. -
getMethods
Return all of theJavaMethodsfor thisJavaClass.- Specified by:
getMethodsin interfaceJavaClass- Returns:
- always returns an empty
ArrayList, asJavaTypesdo not have methods.
-
getModifiers
public int getModifiers()Returns the Java language modifiers for thisJavaClass, encoded in an integer.- Specified by:
getModifiersin interfaceJavaClass- Returns:
- always returns
0asJavaTypesdo not have modifiers. - See Also:
-
getName
Returns the name of thisJavaClass. -
getPackage
Returns theJavaPackagethat thisJavaClassbelongs to.- Specified by:
getPackagein interfaceJavaClass- Returns:
- the
JavaPackageof thisJavaClass.
-
getPackageName
Returns the package name of thisJavaClass.- Specified by:
getPackageNamein interfaceJavaClass- Returns:
- the
Stringname of thisJavaClass'JavaPackage.
-
getQualifiedName
Returns the fully-qualified name of thisJavaClass.- Specified by:
getQualifiedNamein interfaceJavaClass- Returns:
- the
Stringname of thisJavaClass.
-
getRawName
Returns the raw name of thisJavaClass. Array types will have "[]" appended to the name.- Specified by:
getRawNamein interfaceJavaClass- Returns:
- the
Stringraw name of thisJavaClass.
-
getSuperclass
Returns the super class of thisJavaClass.- Specified by:
getSuperclassin interfaceJavaClass- Returns:
JavaClassrepresenting the super class of thisJavaClass.
-
getGenericInterfaces
- Specified by:
getGenericInterfacesin interfaceJavaClass
-
getGenericSuperclass
- Specified by:
getGenericSuperclassin interfaceJavaClass
-
hasActualTypeArguments
public boolean hasActualTypeArguments()Indicates if thisJavaClasshas actual type arguments, i.e. is a parameterized type (for example,List<Employee).- Specified by:
hasActualTypeArgumentsin interfaceJavaClass- Returns:
- always returns
falseasJavaTypesare not parameterized.
-
isAbstract
public boolean isAbstract()Indicates if thisJavaClassisabstract.- Specified by:
isAbstractin interfaceJavaClass- Returns:
- always returns
falseasJavaTypesare neverabstract.
-
isAnnotation
public boolean isAnnotation()Indicates if thisJavaClassis anAnnotation.- Specified by:
isAnnotationin interfaceJavaClass- Returns:
- always returns
falseasJavaTypesare neverAnnotations.
-
isArray
public boolean isArray()Indicates if thisJavaClassis an Array type. -
isAssignableFrom
Indicates if thisJavaClassis either the same as, or is a superclass of, thejavaClassargument.- Specified by:
isAssignableFromin interfaceJavaClass- Parameters:
arg0- theClassto test.- Returns:
trueif thisJavaClassis assignable fromjavaClass, otherwisefalse.- See Also:
-
isEnum
public boolean isEnum()Indicates if thisJavaClassis anenum. -
isFinal
public boolean isFinal()Indicates if thisJavaClassisfinal. -
isInterface
public boolean isInterface()Indicates if thisJavaClassis aninterface.- Specified by:
isInterfacein interfaceJavaClass- Returns:
trueif thisJavaClassis aninterface, otherwisefalse.
-
isMemberClass
public boolean isMemberClass()Indicates if thisJavaClassis an innerClass.- Specified by:
isMemberClassin interfaceJavaClass- Returns:
trueif thisJavaClassis an innerClass, otherwisefalse.
-
isPrimitive
public boolean isPrimitive()Indicates if thisJavaClassrepresents a primitive type.- Specified by:
isPrimitivein interfaceJavaClass- Returns:
trueif thisJavaClassrepresents a primitive type, otherwisefalse.
-
isPrivate
public boolean isPrivate()Indicates if thisJavaClassisprivate. -
isProtected
public boolean isProtected()Indicates if thisJavaClassisprotected.- Specified by:
isProtectedin interfaceJavaClass- Returns:
trueif thisJavaClassisprotected, otherwisefalse.
-
isPublic
public boolean isPublic()Indicates if thisJavaClassispublic. -
isStatic
public boolean isStatic()Indicates if thisJavaClassisstatic. -
isSynthetic
public boolean isSynthetic()Not supported.- Specified by:
isSyntheticin interfaceJavaClass
-
instanceOf
- Specified by:
instanceOfin interfaceJavaClass
-
getAnnotation
If thisJavaClassis annotated with anAnnotationmatchingaClass, return itsJavaAnnotationrepresentation.- Specified by:
getAnnotationin interfaceJavaHasAnnotations- Parameters:
aClass- aJavaClassrepresenting theAnnotationto look for.- Returns:
- always returns
null, asJavaTypesdo not haveAnnotations.
-
getAnnotations
Return all of theAnnotationsfor thisJavaClass.- Specified by:
getAnnotationsin interfaceJavaHasAnnotations- Returns:
- always returns an empty
ArrayList, asJavaTypesdo not haveAnnotations.
-
getDeclaredAnnotation
If thisJavaClassdeclares anAnnotationmatchingaClass, return itsJavaAnnotationrepresentation.- Specified by:
getDeclaredAnnotationin interfaceJavaHasAnnotations- Parameters:
arg0- aJavaClassrepresenting theAnnotationto look for.- Returns:
- always returns
null, asJavaTypesdo not haveAnnotations.
-
getDeclaredAnnotations
Return all of the declaredAnnotationsfor thisJavaClass.- Specified by:
getDeclaredAnnotationsin interfaceJavaHasAnnotations- Returns:
- always returns an empty
ArrayList, asJavaTypesdo not haveAnnotations.
-
setJavaModel
Set thisJavaClass'JavaModel.- Parameters:
model- TheJavaModelto set.
-
getJavaModel
Get thisJavaClass'JavaModel.- Returns:
- The
JavaModelassociated with thisJavaClass.
-