Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

E28847-01


org.eclipse.persistence.jaxb.compiler
Class CompilerHelper

java.lang.Object
  extended by org.eclipse.persistence.jaxb.compiler.CompilerHelper


public class CompilerHelper
extends java.lang.Object

Helper class for code that needs to be shared between AnnotationsProcessor, MappingsGenerator, SchemaGenerator


Field Summary
private static java.lang.String METADATA_MODEL_PACKAGE
           
private static JAXBContext xmlBindingsModelContext
           

 

Constructor Summary
CompilerHelper()
           

 

Method Summary
static void addClassToClassLoader(JavaClass cls, java.lang.ClassLoader loader)
           
private static boolean areTypesEqual(java.lang.reflect.Type type, java.lang.reflect.Type type2)
          Return true if the Types are equal.
private static boolean generatesSameComplexType(TypeMappingInfo tmi1, TypeMappingInfo tmi2, java.lang.ClassLoader loader)
          Return true if the two TypeMappingInfoObjects should generate the same complex type in the XSD
private static java.lang.reflect.Type getActualArgumentType(java.lang.reflect.Type argument)
           
(package private) static java.lang.reflect.Type getActualType(TypeMappingInfo tmi, XmlElement element)
          The actual type accounts for adapter classes or xmlelemnt types specified in either an annotation or an XML override
(package private) static java.lang.Class getExisitingGeneratedClass(TypeMappingInfo tmi, java.util.Map<TypeMappingInfo,java.lang.Class> typeMappingInfoToGeneratedClasses, java.util.Map<TypeMappingInfo,java.lang.Class> typeMappingInfoToAdapterClasses, java.lang.ClassLoader loader)
          If 2 TypeMappingInfo objects would generate the same generated class (and therefore complex type) then return the existing class otherwise return null.
static JavaClass getNextMappedSuperClass(JavaClass cls, java.util.HashMap<java.lang.String,TypeInfo> typeInfo, Helper helper)
           
(package private) static java.lang.Class getTypeFromAdapterClass(java.lang.Class adapterClass)
          If adapter class is null return null If there is a marshal method that returns something other than Object on the adapter class return the return type of that method Otherwise return Object.class
static JAXBContext getXmlBindingsModelContext()
          The method will load the eclipselink metadata model and return the corresponding JAXBContext
(package private) static XmlElement getXmlElement(org.w3c.dom.Element xmlElementNode, java.lang.ClassLoader classLoader)
          Convenience method for creating an XmlElement object based on a given Element.
private static boolean isCollectionType(java.lang.reflect.Type theType)
          Return true if the type is a Collection, List or Set
private static boolean isXmlList(TypeMappingInfo tmi, XmlElement element)
          Return if this TypeMappingInfo has an XmlList annotation or is specified to be an xmlList in an XMLElement override

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

xmlBindingsModelContext

private static JAXBContext xmlBindingsModelContext

METADATA_MODEL_PACKAGE

private static final java.lang.String METADATA_MODEL_PACKAGE
See Also:
Constant Field Values

Constructor Detail

CompilerHelper

public CompilerHelper()

Method Detail

getExisitingGeneratedClass

static java.lang.Class getExisitingGeneratedClass(TypeMappingInfo tmi,
                                                  java.util.Map<TypeMappingInfo,java.lang.Class> typeMappingInfoToGeneratedClasses,
                                                  java.util.Map<TypeMappingInfo,java.lang.Class> typeMappingInfoToAdapterClasses,
                                                  java.lang.ClassLoader loader)
If 2 TypeMappingInfo objects would generate the same generated class (and therefore complex type) then return the existing class otherwise return null.

generatesSameComplexType

private static boolean generatesSameComplexType(TypeMappingInfo tmi1,
                                                TypeMappingInfo tmi2,
                                                java.lang.ClassLoader loader)
Return true if the two TypeMappingInfoObjects should generate the same complex type in the XSD

isXmlList

private static boolean isXmlList(TypeMappingInfo tmi,
                                 XmlElement element)
Return if this TypeMappingInfo has an XmlList annotation or is specified to be an xmlList in an XMLElement override

areTypesEqual

private static boolean areTypesEqual(java.lang.reflect.Type type,
                                     java.lang.reflect.Type type2)
Return true if the Types are equal. Accounts for Classes and Parameterized types or any combintation of the two.

getActualArgumentType

private static java.lang.reflect.Type getActualArgumentType(java.lang.reflect.Type argument)

getXmlElement

static XmlElement getXmlElement(org.w3c.dom.Element xmlElementNode,
                                java.lang.ClassLoader classLoader)
Convenience method for creating an XmlElement object based on a given Element. The method will load the eclipselink metadata model and unmarshal the Element. This assumes that the Element represents an xml-element to be unmarshalled.
Parameters:
xmlElementNode -
classLoader -
Returns:

getTypeFromAdapterClass

static java.lang.Class getTypeFromAdapterClass(java.lang.Class adapterClass)
If adapter class is null return null If there is a marshal method that returns something other than Object on the adapter class return the return type of that method Otherwise return Object.class

isCollectionType

private static boolean isCollectionType(java.lang.reflect.Type theType)
Return true if the type is a Collection, List or Set

getActualType

static java.lang.reflect.Type getActualType(TypeMappingInfo tmi,
                                            XmlElement element)
The actual type accounts for adapter classes or xmlelemnt types specified in either an annotation or an XML override

getXmlBindingsModelContext

public static JAXBContext getXmlBindingsModelContext()
The method will load the eclipselink metadata model and return the corresponding JAXBContext

getNextMappedSuperClass

public static JavaClass getNextMappedSuperClass(JavaClass cls,
                                                java.util.HashMap<java.lang.String,TypeInfo> typeInfo,
                                                Helper helper)

addClassToClassLoader

public static void addClassToClassLoader(JavaClass cls,
                                         java.lang.ClassLoader loader)

Skip navigation links

Copyright © 1998, 2012, Oracle. All Rights Reserved.