Class Helper
java.lang.Object
org.eclipse.persistence.jaxb.javamodel.Helper
INTERNAL:
Purpose:To provide helper methods and constants to assist in integrating TopLink JAXB 2.0 Generation with the JDEV JOT APIs.
Responsibilities:
- Make available a map of JOT - XML type pairs
- Redirect method calls to the current JavaModel implementation as required
- Provide methods for accessing generics, annotations, etc. on a given implementaiton's classes
- Provide a dynamic proxy instance for a given JavaAnnotation in the JOT implementation (for reflection a Java SDK annotation is returned)
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected JavaModel
protected ClassLoader
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
classExistsInArray
(JavaClass theClass, List<JavaClass> existingClasses) Convenience method to determine if a class exists in a given ArrayList.getAnnotation
(JavaHasAnnotations element, 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.getClassForJavaClass
(JavaClass javaClass) Return a given method's generic return type as a JavaClass.getJavaClass
(Class javaClass) Return a JavaClass instance created based the provided class.getJavaClass
(String javaClassName) Return a JavaClass instance created based on fully qualified class name.getJavaClassArray
(Class... classes) Return array of JavaClass instances created based on the provided classes.Return a JavaClass instance based on the @see jakarta.xml.bind.JAXBElement .Return a JavaClass instance based on the @see java.lang.Object .static String
getQualifiedJavaTypeName
(String javaTypeName, String packageName) Prepends a package name to a given java type name, if it is not already present.Returns a JavaClass instance wrapping the provided field's resolved type.Return a map of default Java types to XML types.boolean
isAnnotationPresent
(JavaHasAnnotations element, 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
isFacets()
boolean
void
setClassLoader
(ClassLoader loader) void
setFacets
(boolean facets) void
setJavaModel
(JavaModel model)
-
Field Details
-
loader
-
jModel
-
APBYTE
- See Also:
-
BIGDECIMAL
- See Also:
-
BIGINTEGER
- See Also:
-
PBOOLEAN
- See Also:
-
PBYTE
- See Also:
-
CALENDAR
- See Also:
-
CHARACTER
- See Also:
-
CHAR
- See Also:
-
OBJECT
- See Also:
-
CLASS
- See Also:
-
PDOUBLE
- See Also:
-
PFLOAT
- See Also:
-
PINT
- See Also:
-
PLONG
- See Also:
-
PSHORT
- See Also:
-
QNAME_CLASS
- See Also:
-
STRING
- See Also:
-
ABYTE
- See Also:
-
BOOLEAN
- See Also:
-
BYTE
- See Also:
-
GREGORIAN_CALENDAR
- See Also:
-
DOUBLE
- See Also:
-
FLOAT
- See Also:
-
INTEGER
- See Also:
-
UUID
- See Also:
-
LONG
- See Also:
-
SHORT
- See Also:
-
UTIL_DATE
- See Also:
-
SQL_DATE
- See Also:
-
SQL_TIME
- See Also:
-
SQL_TIMESTAMP
- See Also:
-
DURATION
- See Also:
-
XMLGREGORIANCALENDAR
- See Also:
-
URI
- See Also:
-
URL
- See Also:
-
JAVA_PKG
- See Also:
-
JAVAX_PKG
- See Also:
-
JAKARTA_PKG
- See Also:
-
JAVAX_WS_PKG
- See Also:
-
JAKARTA_WS_PKG
- See Also:
-
JAVAX_RPC_PKG
- See Also:
-
JAKARTA_RPC_PKG
- See Also:
-
-
Constructor Details
-
Helper
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 Details
-
getGenericReturnType
Return a given method's generic return type as a JavaClass.- Parameters:
meth
-- Returns:
-
getJavaClass
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:
-
getJavaClassArray
Return array of JavaClass instances created based on the provided classes. This assumes provided classes exist on the classpath.- Parameters:
classes
-- Returns:
- JavaClass array
-
getJavaClass
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
Return a map of default Java types to XML types.- Returns:
-
getAnnotation
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:
-
getType
Returns a JavaClass instance wrapping the provided field's resolved type.- Parameters:
field
-- Returns:
-
getJaxbElementClass
Return a JavaClass instance based on the @see jakarta.xml.bind.JAXBElement . Replacement of direct access to JAXBELEMENT_CLASS field.- Returns:
-
getObjectClass
Return a JavaClass instance based on the @see java.lang.Object . Replacement of direct access to OBJECT_CLASS field.- Returns:
-
isAnnotationPresent
Indicates if element contains a given annotation.- Parameters:
element
-annotationClass
-- Returns:
-
isBuiltInJavaType
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 "jakarta.xml.ws." and "javax.xml.rpc"- Parameters:
jClass
-- Returns:
-
setClassLoader
-
setJavaModel
-
getClassLoader
-
getClassForJavaClass
-
classExistsInArray
Convenience method to determine if a class exists in a given ArrayList. -
getQualifiedJavaTypeName
Prepends a package name to a given java type name, if it is not already present.- Parameters:
javaTypeName
- Java type name that may/may not contain 'packageName'packageName
- package name to prepend to javaTypeName if not already- Returns:
- fully qualified java type name
-
isCollectionType
-
isMapType
-
isFacets
public boolean isFacets() -
setFacets
public void setFacets(boolean facets)
-