EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.jaxb.javamodel.oxm
Class OXMJavaClassImpl

java.lang.Object
  extended by org.eclipse.persistence.jaxb.javamodel.oxm.OXMJavaClassImpl
All Implemented Interfaces:
JavaClass, JavaHasAnnotations

public class OXMJavaClassImpl
extends java.lang.Object
implements JavaClass

INTERNAL:

Purpose: JavaClass implementation wrapping MOXy's xmlmodel.JavaType. Used when bootstrapping a DynamicJAXBContext from XML Bindings.

Responsibilities:

See Also:
JavaClass, JavaType
Since:
EclipseLink 2.2

Constructor Summary
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.
 
Method Summary
 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 getGenericSuperclass()
           
 JavaModel getJavaModel()
          Set 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).
 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)
          Get this JavaClass' JavaModel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OXMJavaClassImpl

public OXMJavaClassImpl(JavaType aJavaType)
Construct a new instance of OXMJavaClassImpl.

Parameters:
aJavaType - - the XJC JavaType to be wrapped.

OXMJavaClassImpl

public OXMJavaClassImpl(java.lang.String aJavaTypeName)
Construct a new instance of OXMJavaClassImpl.

Parameters:
aJavaTypeName - - the name of the JavaType to create.

OXMJavaClassImpl

public OXMJavaClassImpl(java.lang.String aJavaTypeName,
                        java.util.List<java.lang.String> enumValues)
Construct a new instance of OXMJavaClassImpl representing a Java enum.

Parameters:
aJavaTypeName - - the name of the JavaType to create.
enumValues - - the list of values for this enum.
Method Detail

getActualTypeArguments

public java.util.Collection<JavaClass> getActualTypeArguments()
Return the "actual" type from a parameterized type. For example, if this JavaClass represents List<Employee, this method will return the Employee JavaClass.

Specified by:
getActualTypeArguments in interface JavaClass
Returns:
a Collection containing the actual type's JavaClass.

getComponentType

public JavaClass getComponentType()
If this JavaClass is an array type, return the type of the array components.

Specified by:
getComponentType in interface JavaClass
Returns:
always returns null, as JavaTypes do not represent arrays.

getConstructor

public JavaConstructor getConstructor(JavaClass[] parameterTypes)
Return the JavaConstructor for this JavaClass that has the provided parameter types.

Specified by:
getConstructor in interface JavaClass
Parameters:
parameterTypes - the parameter list used to identify the constructor.
Returns:
the JavaConstructor with the signature matching parameterTypes.

getConstructors

public java.util.Collection<JavaConstructor> getConstructors()
Return all of the JavaConstructors for this JavaClass.

Specified by:
getConstructors in interface JavaClass
Returns:
A Collection containing this JavaClass' JavaConstructors.

getDeclaredClasses

public java.util.Collection<JavaClass> getDeclaredClasses()
Return this JavaClass' inner classes.

Specified by:
getDeclaredClasses in interface JavaClass
Returns:
always returns an empty ArrayList as JavaTypes do not represent inner classes.

getDeclaredConstructor

public JavaConstructor getDeclaredConstructor(JavaClass[] parameterTypes)
Return the declared JavaConstructor for this JavaClass.

Specified by:
getDeclaredConstructor in interface JavaClass
Returns:
the JavaConstructor for this JavaClass.

getDeclaredConstructors

public java.util.Collection<JavaConstructor> getDeclaredConstructors()
Return all of the declared JavaConstructors for this JavaClass.

Specified by:
getDeclaredConstructors in interface JavaClass
Returns:
A Collection containing this JavaClass' JavaConstructors.

getDeclaredField

public JavaField getDeclaredField(java.lang.String name)
Return the declared JavaField for this JavaClass, identified by fieldName.

Specified by:
getDeclaredField in interface JavaClass
Parameters:
name - the name of the JavaField to return.
Returns:
the JavaField named fieldName from this JavaClass.

getDeclaredFields

public java.util.Collection<JavaField> getDeclaredFields()
Return all of the declared JavaFields for this JavaClass.

Specified by:
getDeclaredFields in interface JavaClass
Returns:
A Collection containing this JavaClass' JavaFields.

getDeclaredMethod

public JavaMethod getDeclaredMethod(java.lang.String name,
                                    JavaClass[] args)
Return the declared JavaMethod for this JavaClass, identified by name, with the signature matching args.

Specified by:
getDeclaredMethod in interface JavaClass
Parameters:
name - the name of the JavaMethod to return.
args - the parameter list used to identify the method.
Returns:
always returns null, as JavaTypes do not have methods.

getDeclaredMethods

public java.util.Collection<JavaMethod> getDeclaredMethods()
Return all of the declared JavaMethods for this JavaClass.

Specified by:
getDeclaredMethods in interface JavaClass
Returns:
always returns an empty ArrayList, as JavaTypes do not have methods.

getMethod

public JavaMethod getMethod(java.lang.String name,
                            JavaClass[] args)
Return the JavaMethod for this JavaClass, identified by name, with the signature matching args.

Specified by:
getMethod in interface JavaClass
Parameters:
name - the name of the JavaMethod to return.
args - the parameter list used to identify the method.
Returns:
always returns null, as JavaTypes do not have methods.

getMethods

public java.util.Collection<JavaMethod> getMethods()
Return all of the JavaMethods for this JavaClass.

Specified by:
getMethods in interface JavaClass
Returns:
always returns an empty ArrayList, as JavaTypes do not have methods.

getModifiers

public int getModifiers()
Returns the Java language modifiers for this JavaClass, encoded in an integer.

Specified by:
getModifiers in interface JavaClass
Returns:
always returns 0 as JavaTypes do not have modifiers.
See Also:
Modifier

getName

public java.lang.String getName()
Returns the name of this JavaClass.

Specified by:
getName in interface JavaClass
Returns:
the String name of this JavaClass.

getPackage

public JavaPackage getPackage()
Returns the JavaPackage that this JavaClass belongs to.

Specified by:
getPackage in interface JavaClass
Returns:
the JavaPackage of this JavaClass.

getPackageName

public java.lang.String getPackageName()
Returns the package name of this JavaClass.

Specified by:
getPackageName in interface JavaClass
Returns:
the String name of this JavaClass' JavaPackage.

getQualifiedName

public java.lang.String getQualifiedName()
Returns the fully-qualified name of this JavaClass.

Specified by:
getQualifiedName in interface JavaClass
Returns:
the String name of this JavaClass.

getRawName

public java.lang.String getRawName()
Returns the raw name of this JavaClass. Array types will have "[]" appended to the name.

Specified by:
getRawName in interface JavaClass
Returns:
the String raw name of this JavaClass.

getSuperclass

public JavaClass getSuperclass()
Returns the super class of this JavaClass.

Specified by:
getSuperclass in interface JavaClass
Returns:
JavaClass representing the super class of this JavaClass.

getGenericSuperclass

public java.lang.reflect.Type getGenericSuperclass()
Specified by:
getGenericSuperclass in interface JavaClass

hasActualTypeArguments

public boolean hasActualTypeArguments()
Indicates if this JavaClass has actual type arguments, i.e. is a parameterized type (for example, List<Employee).

Specified by:
hasActualTypeArguments in interface JavaClass
Returns:
always returns false as JavaTypes are not parameterized.

isAbstract

public boolean isAbstract()
Indicates if this JavaClass is abstract.

Specified by:
isAbstract in interface JavaClass
Returns:
always returns false as JavaTypes are never abstract.

isAnnotation

public boolean isAnnotation()
Indicates if this JavaClass is an Annotation.

Specified by:
isAnnotation in interface JavaClass
Returns:
always returns false as JavaTypes are never Annotations.

isArray

public boolean isArray()
Indicates if this JavaClass is an Array type.

Specified by:
isArray in interface JavaClass
Returns:
always returns false, as JavaTypes do not represent arrays.

isAssignableFrom

public boolean isAssignableFrom(JavaClass arg0)
Indicates if this JavaClass is either the same as, or is a superclass of, the javaClass argument.

Specified by:
isAssignableFrom in interface JavaClass
Parameters:
javaClass - the Class to test.
Returns:
true if this JavaClass is assignable from javaClass, otherwise false.
See Also:
Class.isAssignableFrom(Class)

isEnum

public boolean isEnum()
Indicates if this JavaClass is an enum.

Specified by:
isEnum in interface JavaClass
Returns:
true if this JavaClass is an enum, otherwise false.

isFinal

public boolean isFinal()
Indicates if this JavaClass is final.

Specified by:
isFinal in interface JavaClass
Returns:
true if this JavaClass is final, otherwise false.

isInterface

public boolean isInterface()
Indicates if this JavaClass is an interface.

Specified by:
isInterface in interface JavaClass
Returns:
true if this JavaClass is an interface, otherwise false.

isMemberClass

public boolean isMemberClass()
Indicates if this JavaClass is an inner Class.

Specified by:
isMemberClass in interface JavaClass
Returns:
true if this JavaClass is an inner Class, otherwise false.

isPrimitive

public boolean isPrimitive()
Indicates if this JavaClass represents a primitive type.

Specified by:
isPrimitive in interface JavaClass
Returns:
true if this JavaClass represents a primitive type, otherwise false.

isPrivate

public boolean isPrivate()
Indicates if this JavaClass is private.

Specified by:
isPrivate in interface JavaClass
Returns:
true if this JavaClass is private, otherwise false.

isProtected

public boolean isProtected()
Indicates if this JavaClass is protected.

Specified by:
isProtected in interface JavaClass
Returns:
true if this JavaClass is protected, otherwise false.

isPublic

public boolean isPublic()
Indicates if this JavaClass is public.

Specified by:
isPublic in interface JavaClass
Returns:
true if this JavaClass is public, otherwise false.

isStatic

public boolean isStatic()
Indicates if this JavaClass is static.

Specified by:
isStatic in interface JavaClass
Returns:
true if this JavaClass is static, otherwise false.

isSynthetic

public boolean isSynthetic()
Not supported.

Specified by:
isSynthetic in interface JavaClass

getAnnotation

public JavaAnnotation getAnnotation(JavaClass aClass)
If this JavaClass is annotated with an Annotation matching aClass, return its JavaAnnotation representation.

Specified by:
getAnnotation in interface JavaHasAnnotations
Parameters:
aClass - a JavaClass representing the Annotation to look for.
Returns:
always returns null, as JavaTypes do not have Annotations.

getAnnotations

public java.util.Collection<JavaAnnotation> getAnnotations()
Return all of the Annotations for this JavaClass.

Specified by:
getAnnotations in interface JavaHasAnnotations
Returns:
always returns an empty ArrayList, as JavaTypes do not have Annotations.

getDeclaredAnnotation

public JavaAnnotation getDeclaredAnnotation(JavaClass arg0)
If this JavaClass declares an Annotation matching aClass, return its JavaAnnotation representation.

Specified by:
getDeclaredAnnotation in interface JavaHasAnnotations
Parameters:
aClass - a JavaClass representing the Annotation to look for.
Returns:
always returns null, as JavaTypes do not have Annotations.

getDeclaredAnnotations

public java.util.Collection<JavaAnnotation> getDeclaredAnnotations()
Return all of the declared Annotations for this JavaClass.

Specified by:
getDeclaredAnnotations in interface JavaHasAnnotations
Returns:
always returns an empty ArrayList, as JavaTypes do not have Annotations.

setJavaModel

public void setJavaModel(JavaModel model)
Get this JavaClass' JavaModel.


getJavaModel

public JavaModel getJavaModel()
Set this JavaClass' JavaModel.

Parameters:
javaModel - The JavaModel to set.

EclipseLink 2.4.2, build 'v20130514-5956486' API Reference