EclipseLink 1.1.4, build 'v20100812-r7860' API Reference

org.eclipse.persistence.jaxb.compiler
Class MappingsGenerator

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

public class MappingsGenerator
extends java.lang.Object

INTERNAL:

Purpose:To generate a TopLink OXM Project based on Java Class and TypeInfo information

Responsibilities:

This class is invoked by a Generator in order to create a TopLink Project. This is generally used by JAXBContextFactory to create the runtime project. A Descriptor will be generated for each TypeInfo and Mappings generated for each Property. In the case that a non-transient property's type is a user defined class, a Descriptor and Mappings will be generated for that class as well.

See Also:
Generator, TypeInfo, Property
Author:
mmacivor
Since:
Oracle TopLink 11.1.1.0.0

Constructor Summary
MappingsGenerator(Helper helper)
           
 
Method Summary
protected  boolean areEquals(JavaClass src, java.lang.Class tgt)
           
 void generateAnyAttributeMapping(Property property, XMLDescriptor descriptor, NamespaceInfo namespaceInfo)
           
 XMLAnyCollectionMapping generateAnyCollectionMapping(Property property, XMLDescriptor descriptor, NamespaceInfo namespaceInfo)
           
 XMLBinaryDataMapping generateBinaryMapping(Property property, XMLDescriptor descriptor, NamespaceInfo namespaceInfo)
           
 XMLChoiceCollectionMapping generateChoiceCollectionMapping(Property property, XMLDescriptor descriptor, NamespaceInfo namespace)
           
 XMLChoiceObjectMapping generateChoiceMapping(Property property, XMLDescriptor descriptor, NamespaceInfo namespace)
           
 void generateCollectionMapping(Property property, XMLDescriptor descriptor, NamespaceInfo namespaceInfo)
           
 XMLMapping generateCollectionMappingForReferenceProperty(ReferenceProperty property, XMLDescriptor descriptor, NamespaceInfo namespaceInfo)
           
 XMLCompositeCollectionMapping generateCompositeCollectionMapping(Property property, XMLDescriptor descriptor, NamespaceInfo namespaceInfo, JavaClass referenceClass)
           
 XMLCompositeObjectMapping generateCompositeObjectMapping(Property property, XMLDescriptor descriptor, NamespaceInfo namespaceInfo, JavaClass referenceClass)
           
 void generateDescriptor(JavaClass javaClass, Project project)
           
 XMLCompositeDirectCollectionMapping generateDirectCollectionMapping(Property property, XMLDescriptor descriptor, NamespaceInfo namespaceInfo)
           
 void generateDirectEnumerationMapping(Property property, XMLDescriptor descriptor, NamespaceInfo namespaceInfo, EnumTypeInfo enumInfo)
           
 XMLDirectMapping generateDirectMapping(Property property, XMLDescriptor descriptor, NamespaceInfo namespaceInfo)
           
 void generateEnumCollectionMapping(Property property, EnumTypeInfo info, XMLDescriptor descriptor, NamespaceInfo namespaceInfo)
           
 void generateMapping(Property property, XMLDescriptor descriptor, NamespaceInfo namespaceInfo)
           
 XMLMapping generateMappingForReferenceProperty(ReferenceProperty property, XMLDescriptor descriptor, NamespaceInfo namespaceInfo)
           
 void generateMappings()
           
 void generateMappings(TypeInfo info, XMLDescriptor descriptor, NamespaceInfo namespaceInfo)
           
 Project generateProject(java.util.ArrayList<JavaClass> typeInfoClasses, java.util.HashMap<java.lang.String,TypeInfo> typeInfo, java.util.HashMap userDefinedSchemaTypes, java.util.HashMap<java.lang.String,NamespaceInfo> packageToNamespaceMappings, java.util.HashMap<javax.xml.namespace.QName,ElementDeclaration> globalElements)
           
 java.lang.Class generateWrapperClass(java.lang.String className, java.lang.String attributeType)
           
 void generateXMLCollectionReferenceMapping(Property property, XMLDescriptor descriptor, NamespaceInfo namespaceInfo, JavaClass referenceClass)
          Create an XMLCollectionReferenceMapping and add it to the descriptor.
 void generateXMLObjectReferenceMapping(Property property, XMLDescriptor descriptor, NamespaceInfo namespaceInfo, JavaClass referenceClass)
          Create an XMLObjectReferenceMapping and add it to the descriptor.
 java.util.ArrayList getEnumerationFacetsFor(EnumTypeInfo info)
           
 java.util.ArrayList<Property> getFieldPropertiesForClass(JavaClass cls, TypeInfo info, boolean onlyPublic)
           
 java.util.HashMap<java.lang.Class,javax.xml.namespace.QName> getGeneratedClassesToQName()
           
 java.util.ArrayList getNoAccessTypePropertiesForClass(JavaClass cls, TypeInfo info)
           
 java.lang.String getPrefixForNamespace(java.lang.String URI, NamespaceResolver namespaceResolver)
           
 java.util.ArrayList<Property> getPropertiesForClass(JavaClass cls, TypeInfo info)
           
 java.util.HashMap getPropertyMapFromArrayList(java.util.ArrayList<Property> props)
           
 java.util.ArrayList<Property> getPropertyPropertiesForClass(JavaClass cls, TypeInfo info, boolean onlyPublic)
           
 java.util.ArrayList getPublicMemberPropertiesForClass(JavaClass cls, TypeInfo info)
           
 java.lang.String getSchemaTypeNameForClassName(java.lang.String className)
           
 Property getXmlValueFieldForSimpleContent(java.util.ArrayList<Property> properties)
           
 XMLField getXPathForElement(java.lang.String path, javax.xml.namespace.QName elementName, NamespaceInfo namespaceInfo, boolean isText)
           
 XMLField getXPathForField(Property property, NamespaceInfo namespaceInfo, boolean isTextMapping)
           
 boolean isCollectionType(Property field)
           
 boolean isMapType(Property property)
           
 void processGlobalElements(Project project)
           
 void processSchemaType(javax.xml.bind.annotation.XmlSchemaType type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappingsGenerator

public MappingsGenerator(Helper helper)
Method Detail

generateProject

public Project generateProject(java.util.ArrayList<JavaClass> typeInfoClasses,
                               java.util.HashMap<java.lang.String,TypeInfo> typeInfo,
                               java.util.HashMap userDefinedSchemaTypes,
                               java.util.HashMap<java.lang.String,NamespaceInfo> packageToNamespaceMappings,
                               java.util.HashMap<javax.xml.namespace.QName,ElementDeclaration> globalElements)
                        throws java.lang.Exception
Throws:
java.lang.Exception

generateDescriptor

public void generateDescriptor(JavaClass javaClass,
                               Project project)

generateMapping

public void generateMapping(Property property,
                            XMLDescriptor descriptor,
                            NamespaceInfo namespaceInfo)

generateChoiceMapping

public XMLChoiceObjectMapping generateChoiceMapping(Property property,
                                                    XMLDescriptor descriptor,
                                                    NamespaceInfo namespace)

generateChoiceCollectionMapping

public XMLChoiceCollectionMapping generateChoiceCollectionMapping(Property property,
                                                                  XMLDescriptor descriptor,
                                                                  NamespaceInfo namespace)

generateMappingForReferenceProperty

public XMLMapping generateMappingForReferenceProperty(ReferenceProperty property,
                                                      XMLDescriptor descriptor,
                                                      NamespaceInfo namespaceInfo)

generateCollectionMappingForReferenceProperty

public XMLMapping generateCollectionMappingForReferenceProperty(ReferenceProperty property,
                                                                XMLDescriptor descriptor,
                                                                NamespaceInfo namespaceInfo)

generateAnyCollectionMapping

public XMLAnyCollectionMapping generateAnyCollectionMapping(Property property,
                                                            XMLDescriptor descriptor,
                                                            NamespaceInfo namespaceInfo)

generateCompositeObjectMapping

public XMLCompositeObjectMapping generateCompositeObjectMapping(Property property,
                                                                XMLDescriptor descriptor,
                                                                NamespaceInfo namespaceInfo,
                                                                JavaClass referenceClass)

generateDirectMapping

public XMLDirectMapping generateDirectMapping(Property property,
                                              XMLDescriptor descriptor,
                                              NamespaceInfo namespaceInfo)

generateBinaryMapping

public XMLBinaryDataMapping generateBinaryMapping(Property property,
                                                  XMLDescriptor descriptor,
                                                  NamespaceInfo namespaceInfo)

generateDirectEnumerationMapping

public void generateDirectEnumerationMapping(Property property,
                                             XMLDescriptor descriptor,
                                             NamespaceInfo namespaceInfo,
                                             EnumTypeInfo enumInfo)

generateCollectionMapping

public void generateCollectionMapping(Property property,
                                      XMLDescriptor descriptor,
                                      NamespaceInfo namespaceInfo)

generateEnumCollectionMapping

public void generateEnumCollectionMapping(Property property,
                                          EnumTypeInfo info,
                                          XMLDescriptor descriptor,
                                          NamespaceInfo namespaceInfo)

generateAnyAttributeMapping

public void generateAnyAttributeMapping(Property property,
                                        XMLDescriptor descriptor,
                                        NamespaceInfo namespaceInfo)

areEquals

protected boolean areEquals(JavaClass src,
                            java.lang.Class tgt)

generateCompositeCollectionMapping

public XMLCompositeCollectionMapping generateCompositeCollectionMapping(Property property,
                                                                        XMLDescriptor descriptor,
                                                                        NamespaceInfo namespaceInfo,
                                                                        JavaClass referenceClass)

generateDirectCollectionMapping

public XMLCompositeDirectCollectionMapping generateDirectCollectionMapping(Property property,
                                                                           XMLDescriptor descriptor,
                                                                           NamespaceInfo namespaceInfo)

getPrefixForNamespace

public java.lang.String getPrefixForNamespace(java.lang.String URI,
                                              NamespaceResolver namespaceResolver)

isCollectionType

public boolean isCollectionType(Property field)

generateMappings

public void generateMappings()

generateMappings

public void generateMappings(TypeInfo info,
                             XMLDescriptor descriptor,
                             NamespaceInfo namespaceInfo)

generateXMLCollectionReferenceMapping

public void generateXMLCollectionReferenceMapping(Property property,
                                                  XMLDescriptor descriptor,
                                                  NamespaceInfo namespaceInfo,
                                                  JavaClass referenceClass)
Create an XMLCollectionReferenceMapping and add it to the descriptor.

Parameters:
property -
descriptor -
namespaceInfo -
referenceClass -

generateXMLObjectReferenceMapping

public void generateXMLObjectReferenceMapping(Property property,
                                              XMLDescriptor descriptor,
                                              NamespaceInfo namespaceInfo,
                                              JavaClass referenceClass)
Create an XMLObjectReferenceMapping and add it to the descriptor.

Parameters:
property -
descriptor -
namespaceInfo -
referenceClass -

getXPathForField

public XMLField getXPathForField(Property property,
                                 NamespaceInfo namespaceInfo,
                                 boolean isTextMapping)

getXPathForElement

public XMLField getXPathForElement(java.lang.String path,
                                   javax.xml.namespace.QName elementName,
                                   NamespaceInfo namespaceInfo,
                                   boolean isText)

getXmlValueFieldForSimpleContent

public Property getXmlValueFieldForSimpleContent(java.util.ArrayList<Property> properties)

getPropertiesForClass

public java.util.ArrayList<Property> getPropertiesForClass(JavaClass cls,
                                                           TypeInfo info)

getFieldPropertiesForClass

public java.util.ArrayList<Property> getFieldPropertiesForClass(JavaClass cls,
                                                                TypeInfo info,
                                                                boolean onlyPublic)

getPropertyPropertiesForClass

public java.util.ArrayList<Property> getPropertyPropertiesForClass(JavaClass cls,
                                                                   TypeInfo info,
                                                                   boolean onlyPublic)

getPublicMemberPropertiesForClass

public java.util.ArrayList getPublicMemberPropertiesForClass(JavaClass cls,
                                                             TypeInfo info)

getPropertyMapFromArrayList

public java.util.HashMap getPropertyMapFromArrayList(java.util.ArrayList<Property> props)

getNoAccessTypePropertiesForClass

public java.util.ArrayList getNoAccessTypePropertiesForClass(JavaClass cls,
                                                             TypeInfo info)

processSchemaType

public void processSchemaType(javax.xml.bind.annotation.XmlSchemaType type)

getEnumerationFacetsFor

public java.util.ArrayList getEnumerationFacetsFor(EnumTypeInfo info)

getSchemaTypeNameForClassName

public java.lang.String getSchemaTypeNameForClassName(java.lang.String className)

isMapType

public boolean isMapType(Property property)

processGlobalElements

public void processGlobalElements(Project project)

getGeneratedClassesToQName

public java.util.HashMap<java.lang.Class,javax.xml.namespace.QName> getGeneratedClassesToQName()

generateWrapperClass

public java.lang.Class generateWrapperClass(java.lang.String className,
                                            java.lang.String attributeType)

EclipseLink 1.1.4, build 'v20100812-r7860' API Reference