public class Helper
extends java.lang.Object
Purpose:To provide helper methods and constants to assist in integrating TopLink JAXB 2.0 Generation with the JDEV JOT APIs.
Responsibilities:
org.eclipse.persistence.jaxb20.javamodel.JavaModel
,
org.eclipse.persistence.jaxb20.javamodel.jot.AnnotationProxy
Modifier and Type | Field and Description |
---|---|
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 |
CLASS |
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 |
static JavaClass |
JAXBELEMENT_CLASS |
protected JavaModel |
jModel |
protected java.lang.ClassLoader |
loader |
static java.lang.String |
LONG |
static java.lang.String |
OBJECT |
static JavaClass |
OBJECT_CLASS |
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 |
URL |
static java.lang.String |
UTIL_DATE |
static java.lang.String |
UUID |
static java.lang.String |
XMLGREGORIANCALENDAR |
Constructor and Description |
---|
Helper(JavaModel model)
INTERNAL:
This is the preferred constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
static java.lang.String |
getQualifiedJavaTypeName(java.lang.String javaTypeName,
java.lang.String packageName)
Prepends a package name to a given java type name, if it is not already present.
|
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.
|
boolean |
isCollectionType(JavaClass type) |
boolean |
isMapType(JavaClass type) |
void |
setClassLoader(java.lang.ClassLoader loader) |
void |
setJavaModel(JavaModel model) |
protected java.lang.ClassLoader loader
protected JavaModel jModel
public static final java.lang.String APBYTE
public static final java.lang.String BIGDECIMAL
public static final java.lang.String BIGINTEGER
public static final java.lang.String PBOOLEAN
public static final java.lang.String PBYTE
public static final java.lang.String CALENDAR
public static final java.lang.String CHARACTER
public static final java.lang.String CHAR
public static final java.lang.String OBJECT
public static final java.lang.String CLASS
public static final java.lang.String PDOUBLE
public static final java.lang.String PFLOAT
public static final java.lang.String PINT
public static final java.lang.String PLONG
public static final java.lang.String PSHORT
public static final java.lang.String QNAME_CLASS
public static final java.lang.String STRING
public static final java.lang.String ABYTE
public static final java.lang.String BOOLEAN
public static final java.lang.String BYTE
public static final java.lang.String GREGORIAN_CALENDAR
public static final java.lang.String DOUBLE
public static final java.lang.String FLOAT
public static final java.lang.String INTEGER
public static final java.lang.String UUID
public static final java.lang.String LONG
public static final java.lang.String SHORT
public static final java.lang.String UTIL_DATE
public static final java.lang.String SQL_DATE
public static final java.lang.String SQL_TIME
public static final java.lang.String SQL_TIMESTAMP
public static final java.lang.String DURATION
public static final java.lang.String XMLGREGORIANCALENDAR
public static final java.lang.String URI
public static final java.lang.String URL
protected static final java.lang.String JAVA_PKG
protected static final java.lang.String JAVAX_PKG
protected static final java.lang.String JAVAX_WS_PKG
public static JavaClass JAXBELEMENT_CLASS
public static JavaClass OBJECT_CLASS
public Helper(JavaModel model)
model
- public JavaClass getGenericReturnType(JavaMethod meth)
meth
- public JavaClass getJavaClass(java.lang.Class javaClass)
javaClass
- public JavaClass getJavaClass(java.lang.String javaClassName)
javaClassName
- public java.util.HashMap getXMLToJavaTypeMap()
public java.lang.annotation.Annotation getAnnotation(JavaHasAnnotations element, java.lang.Class annotationClass)
element
- annotationClass
- isAnnotationPresent
public JavaClass getType(JavaField field)
field
- public boolean isAnnotationPresent(JavaHasAnnotations element, java.lang.Class annotationClass)
element
- annotationClass
- public boolean isBuiltInJavaType(JavaClass jClass)
jClass
- public void setClassLoader(java.lang.ClassLoader loader)
public void setJavaModel(JavaModel model)
public java.lang.ClassLoader getClassLoader()
public java.lang.Class getClassForJavaClass(JavaClass javaClass)
public boolean classExistsInArray(JavaClass theClass, java.util.ArrayList<JavaClass> existingClasses)
public static java.lang.String getQualifiedJavaTypeName(java.lang.String javaTypeName, java.lang.String packageName)
javaTypeName
- Java type name that may/may not contain 'packageName'packageName
- package name to prepend to javaTypeName if not alreadypublic boolean isCollectionType(JavaClass type)
public boolean isMapType(JavaClass type)