EclipseLink 2.3.2, build 'v20111125-r10461' API Reference

org.eclipse.persistence.jaxb.javamodel
Class Helper

java.lang.Object
  extended by org.eclipse.persistence.jaxb.javamodel.Helper

public class Helper
extends java.lang.Object

INTERNAL:

Purpose:To provide helper methods and constants to assist in integrating TopLink JAXB 2.0 Generation with the JDEV JOT APIs.

Responsibilities:

See Also:
org.eclipse.persistence.jaxb20.javamodel.JavaModel, org.eclipse.persistence.jaxb20.javamodel.jot.AnnotationProxy
Since:
Oracle TopLink 11.1.1.0.0

Field Summary
static java.lang.String ABYTE
           
static java.lang.String APBYTE
           
static java.lang.String BIGDECIMAL
           
static java.lang.String BIGINTEGER
           
static java.lang.String BOOLEAN
           
static java.lang.String BYTE
           
static java.lang.String CALENDAR
           
static java.lang.String CHAR
           
static java.lang.String CHARACTER
           
static java.lang.String DOUBLE
           
static java.lang.String DURATION
           
static java.lang.String FLOAT
           
static java.lang.String GREGORIAN_CALENDAR
           
static java.lang.String INTEGER
           
protected static java.lang.String JAVA_PKG
           
protected static java.lang.String JAVAX_PKG
           
protected static java.lang.String JAVAX_WS_PKG
           
protected  JavaModel jModel
           
protected  java.lang.ClassLoader loader
           
static java.lang.String LONG
           
static java.lang.String OBJECT
           
static java.lang.String PBOOLEAN
           
static java.lang.String PBYTE
           
static java.lang.String PDOUBLE
           
static java.lang.String PFLOAT
           
static java.lang.String PINT
           
static java.lang.String PLONG
           
static java.lang.String PSHORT
           
static java.lang.String QNAME_CLASS
           
static java.lang.String SHORT
           
static java.lang.String SQL_DATE
           
static java.lang.String SQL_TIME
           
static java.lang.String SQL_TIMESTAMP
           
static java.lang.String STRING
           
static java.lang.String URI
           
static java.lang.String UTIL_DATE
           
static java.lang.String UUID
           
static java.lang.String XMLGREGORIANCALENDAR
           
 
Constructor Summary
Helper(JavaModel model)
          INTERNAL: This is the preferred constructor.
 
Method Summary
 boolean classExistsInArray(JavaClass theClass, java.util.ArrayList<JavaClass> existingClasses)
          Convenience method to determine if a class exists in a given ArrayList.
 java.lang.annotation.Annotation getAnnotation(JavaHasAnnotations element, java.lang.Class annotationClass)
          Returns a either a dynamic proxy instance that allows an element to be treated as an annotation (for JOT), or a Java annotation (for Reflection), or null if the specified annotation does not exist.
 java.lang.Class getClassForJavaClass(JavaClass javaClass)
           
 java.lang.ClassLoader getClassLoader()
           
 JavaClass getGenericReturnType(JavaMethod meth)
          Return a given method's generic return type as a JavaClass.
 JavaClass getJavaClass(java.lang.Class javaClass)
          Return a JavaClass instance created based the provided class.
 JavaClass getJavaClass(java.lang.String javaClassName)
          Return a JavaClass instance created based on fully qualified class name.
 JavaClass getType(JavaField field)
          Returns a JavaClass instance wrapping the provided field's resolved type.
 java.util.HashMap getXMLToJavaTypeMap()
          Return a map of default Java types to XML types.
 boolean isAnnotationPresent(JavaHasAnnotations element, java.lang.Class annotationClass)
          Indicates if element contains a given annotation.
 boolean isBuiltInJavaType(JavaClass jClass)
          Indicates if a given JavaClass is a built-in Java type.
 void setClassLoader(java.lang.ClassLoader loader)
           
 void setJavaModel(JavaModel model)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loader

protected java.lang.ClassLoader loader

jModel

protected JavaModel jModel

APBYTE

public static final java.lang.String APBYTE
See Also:
Constant Field Values

BIGDECIMAL

public static final java.lang.String BIGDECIMAL
See Also:
Constant Field Values

BIGINTEGER

public static final java.lang.String BIGINTEGER
See Also:
Constant Field Values

PBOOLEAN

public static final java.lang.String PBOOLEAN
See Also:
Constant Field Values

PBYTE

public static final java.lang.String PBYTE
See Also:
Constant Field Values

CALENDAR

public static final java.lang.String CALENDAR
See Also:
Constant Field Values

CHARACTER

public static final java.lang.String CHARACTER
See Also:
Constant Field Values

CHAR

public static final java.lang.String CHAR
See Also:
Constant Field Values

OBJECT

public static final java.lang.String OBJECT
See Also:
Constant Field Values

PDOUBLE

public static final java.lang.String PDOUBLE
See Also:
Constant Field Values

PFLOAT

public static final java.lang.String PFLOAT
See Also:
Constant Field Values

PINT

public static final java.lang.String PINT
See Also:
Constant Field Values

PLONG

public static final java.lang.String PLONG
See Also:
Constant Field Values

PSHORT

public static final java.lang.String PSHORT
See Also:
Constant Field Values

QNAME_CLASS

public static final java.lang.String QNAME_CLASS
See Also:
Constant Field Values

STRING

public static final java.lang.String STRING
See Also:
Constant Field Values

ABYTE

public static final java.lang.String ABYTE
See Also:
Constant Field Values

BOOLEAN

public static final java.lang.String BOOLEAN
See Also:
Constant Field Values

BYTE

public static final java.lang.String BYTE
See Also:
Constant Field Values

GREGORIAN_CALENDAR

public static final java.lang.String GREGORIAN_CALENDAR
See Also:
Constant Field Values

DOUBLE

public static final java.lang.String DOUBLE
See Also:
Constant Field Values

FLOAT

public static final java.lang.String FLOAT
See Also:
Constant Field Values

INTEGER

public static final java.lang.String INTEGER
See Also:
Constant Field Values

UUID

public static final java.lang.String UUID
See Also:
Constant Field Values

LONG

public static final java.lang.String LONG
See Also:
Constant Field Values

SHORT

public static final java.lang.String SHORT
See Also:
Constant Field Values

UTIL_DATE

public static final java.lang.String UTIL_DATE
See Also:
Constant Field Values

SQL_DATE

public static final java.lang.String SQL_DATE
See Also:
Constant Field Values

SQL_TIME

public static final java.lang.String SQL_TIME
See Also:
Constant Field Values

SQL_TIMESTAMP

public static final java.lang.String SQL_TIMESTAMP
See Also:
Constant Field Values

DURATION

public static final java.lang.String DURATION
See Also:
Constant Field Values

XMLGREGORIANCALENDAR

public static final java.lang.String XMLGREGORIANCALENDAR
See Also:
Constant Field Values

URI

public static final java.lang.String URI
See Also:
Constant Field Values

JAVA_PKG

protected static final java.lang.String JAVA_PKG
See Also:
Constant Field Values

JAVAX_PKG

protected static final java.lang.String JAVAX_PKG
See Also:
Constant Field Values

JAVAX_WS_PKG

protected static final java.lang.String JAVAX_WS_PKG
See Also:
Constant Field Values
Constructor Detail

Helper

public Helper(JavaModel model)
INTERNAL: This is the preferred constructor. This constructor builds the map of XML-Java type pairs, and sets the JavaModel and ClassLoader.

Parameters:
model -
Method Detail

getGenericReturnType

public JavaClass getGenericReturnType(JavaMethod meth)
Return a given method's generic return type as a JavaClass.

Parameters:
meth -
Returns:

getJavaClass

public JavaClass getJavaClass(java.lang.Class javaClass)
Return a JavaClass instance created based the provided class. This assumes that the provided class exists on the classpath - null is returned otherwise.

Parameters:
javaClass -
Returns:

getJavaClass

public JavaClass getJavaClass(java.lang.String javaClassName)
Return a JavaClass instance created based on fully qualified class name. This assumes that a class with the provided name exists on the classpath - null is returned otherwise.

Parameters:
javaClassName -
Returns:

getXMLToJavaTypeMap

public java.util.HashMap getXMLToJavaTypeMap()
Return a map of default Java types to XML types.

Returns:

getAnnotation

public java.lang.annotation.Annotation getAnnotation(JavaHasAnnotations element,
                                                     java.lang.Class annotationClass)
Returns a either a dynamic proxy instance that allows an element to be treated as an annotation (for JOT), or a Java annotation (for Reflection), or null if the specified annotation does not exist. Intended to be used in conjunction with isAnnotationPresent.

Parameters:
element -
annotationClass -
Returns:
See Also:
isAnnotationPresent

getType

public JavaClass getType(JavaField field)
Returns a JavaClass instance wrapping the provided field's resolved type.

Parameters:
field -
Returns:

isAnnotationPresent

public boolean isAnnotationPresent(JavaHasAnnotations element,
                                   java.lang.Class annotationClass)
Indicates if element contains a given annotation.

Parameters:
element -
annotationClass -
Returns:

isBuiltInJavaType

public boolean isBuiltInJavaType(JavaClass jClass)
Indicates if a given JavaClass is a built-in Java type. A JavaClass is considered to be a built-in type if: 1 - the XMLToJavaTypeMap map contains a key equal to the provided JavaClass' raw name 2 - the provided JavaClass' raw name starts with "java." 3 - the provided JavaClass' raw name starts with "javax.", with the exception of "javax.xml.ws."

Parameters:
jClass -
Returns:

setClassLoader

public void setClassLoader(java.lang.ClassLoader loader)

setJavaModel

public void setJavaModel(JavaModel model)

getClassLoader

public java.lang.ClassLoader getClassLoader()

getClassForJavaClass

public java.lang.Class getClassForJavaClass(JavaClass javaClass)

classExistsInArray

public boolean classExistsInArray(JavaClass theClass,
                                  java.util.ArrayList<JavaClass> existingClasses)
Convenience method to determine if a class exists in a given ArrayList.


EclipseLink 2.3.2, build 'v20111125-r10461' API Reference