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 SchemaGenerator

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


public class SchemaGenerator
extends java.lang.Object

INTERNAL:

Purpose:To generate Schema objects based on a map of TypeInfo objects, and some additional information gathered by the AnnotationsProcessing phase.

Responsibilities:

This class is used by the Generator to handle the generation of Schemas. The Generator passes in a map of TypeInfo objects, generated by the Annotations processor. The generated Schemas are stored in a map of keyed on Target Namespace.

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

Nested Class Summary
(package private)  class SchemaGenerator.AddToSchemaResult
          This class will typically be used when building schema components.

 

Field Summary
private  java.util.List<org.eclipse.persistence.internal.oxm.schema.model.Schema> allSchemas
           
private  java.util.Map<java.lang.String,java.lang.Class> arrayClassesToGeneratedClasses
           
private static java.lang.String ATT
           
private static java.lang.String BUILD_FIELD_VALUE_METHOD
           
private static java.lang.String COLON
           
private static java.lang.String DEFAULT
           
private static java.lang.String DOT
           
private static java.lang.Character DOT_CHAR
           
private static java.lang.String EMPTY_STRING
           
private static java.lang.String ENTRY
           
private static java.lang.String GENERATE
           
private  Helper helper
           
private static java.lang.String ID
           
private static java.lang.String IDREF
           
private static java.lang.String JAVAX_ACTIVATION_DATAHANDLER
           
private static java.lang.String JAVAX_MAIL_INTERNET_MIMEMULTIPART
           
private static java.lang.String OBJECT_CLASSNAME
           
private  javax.xml.bind.SchemaOutputResolver outputResolver
           
private  java.util.HashMap<java.lang.String,PackageInfo> packageToPackageInfoMappings
           
private  org.eclipse.persistence.internal.oxm.schema.model.Schema schema
           
private static java.lang.String SCHEMA
           
private static java.lang.String SCHEMA_EXT
           
private  int schemaCount
           
private  java.util.HashMap<java.lang.String,org.eclipse.persistence.internal.oxm.schema.model.Schema> schemaForNamespace
           
private  java.util.HashMap<java.lang.String,SchemaTypeInfo> schemaTypeInfo
           
private static java.lang.String SKIP
           
private static java.lang.Character SLASH
           
private static java.lang.Character SLASHES
           
private static java.lang.String SWA_REF_IMPORT
           
private  java.util.HashMap<java.lang.String,TypeInfo> typeInfo
           
private  java.util.HashMap<java.lang.String,javax.xml.namespace.QName> userDefinedSchemaTypes
           

 

Constructor Summary
SchemaGenerator(Helper helper)
           

 

Method Summary
private  void addAnyAttributeToSchema(org.eclipse.persistence.internal.oxm.schema.model.ComplexType type)
          Convenience method for processing an any attribute property.
private  void addAnyToSchema(Property property, org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor)
          Convenience method for processing an any property.
private  void addAnyToSchema(Property property, org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor, boolean isCollection)
          Convenience method for processing an any property.
private  void addAnyToSchema(Property property, org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor, boolean isCollection, java.lang.String anyNamespace)
          Convenience method for processing an any property.
private  void addAttributeToSchema(org.eclipse.persistence.internal.oxm.schema.model.Attribute attribute, javax.xml.namespace.QName attributeName, org.eclipse.persistence.internal.oxm.schema.model.Schema schema, org.eclipse.persistence.internal.oxm.schema.model.ComplexType type)
          Convenience method for processing an attribute property.
private  void addChoiceToSchema(Property property, TypeInfo typeInfo, org.eclipse.persistence.internal.oxm.schema.model.ComplexType type, org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor, org.eclipse.persistence.internal.oxm.schema.model.Schema schema)
          Convenience method for processing a choice property.
private  void addElementRefToSchema(org.eclipse.persistence.internal.oxm.schema.model.Schema schema, org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor, org.eclipse.persistence.internal.oxm.schema.model.Element referencedElement, java.lang.String referencedElementURI)
          Convenience method that adds an element ref to a given schema.
private  void addElementToSchema(org.eclipse.persistence.internal.oxm.schema.model.Element element, java.lang.String elementURI, boolean isPositional, org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor, org.eclipse.persistence.internal.oxm.schema.model.Schema schema)
          Convenience method that adds an element to a given schema.
 void addGlobalElements(java.util.HashMap<javax.xml.namespace.QName,ElementDeclaration> additionalElements)
           
private  boolean addImportIfRequired(org.eclipse.persistence.internal.oxm.schema.model.Schema sourceSchema, org.eclipse.persistence.internal.oxm.schema.model.Schema importSchema, java.lang.String importNamespace)
           
private  void addMapToSchema(Property property, org.eclipse.persistence.internal.oxm.schema.model.Element element, org.eclipse.persistence.internal.oxm.schema.model.Schema schema, TypeInfo typeInfo)
          Convenience method for processing a reference property.
private  void addReferenceToSchema(Property property, org.eclipse.persistence.internal.oxm.schema.model.Schema schema, org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor)
          Convenience method for processing a reference property.
 void addSchemaComponents(JavaClass myClass)
           
 void addToSchemaType(TypeInfo ownerTypeInfo, java.util.List<Property> properties, org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor, org.eclipse.persistence.internal.oxm.schema.model.ComplexType type, org.eclipse.persistence.internal.oxm.schema.model.Schema workingSchema)
           
private  void addTransformerToSchema(Property property, TypeInfo typeInfo, org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor, org.eclipse.persistence.internal.oxm.schema.model.ComplexType type, org.eclipse.persistence.internal.oxm.schema.model.Schema schema)
          Convenience method for processing XmlWriteTransformer(s) for a given property.
private  SchemaGenerator.AddToSchemaResult addXmlElementWrapperToSchema(Property property, org.eclipse.persistence.internal.oxm.schema.model.Schema schema, org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor)
          Convenience method for processing an XmlElementWrapper for a given property.
private  void addXmlJoinNodesToSchema(Property property, org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor, org.eclipse.persistence.internal.oxm.schema.model.Schema schema, org.eclipse.persistence.internal.oxm.schema.model.ComplexType type)
          Convenience method that processes the XmlJoinNodes for a given Property and adds the appropriate components to the schema.
private  SchemaGenerator.AddToSchemaResult addXPathToSchema(Property property, org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor, org.eclipse.persistence.internal.oxm.schema.model.Schema schema, boolean isChoice, org.eclipse.persistence.internal.oxm.schema.model.ComplexType type)
          Process a given XmlPath, and create the required schema components.
protected  boolean areEquals(JavaClass src, java.lang.Class tgt)
          Compares a JavaModel JavaClass to a Class.
protected  boolean areEquals(JavaClass src, java.lang.String tgtCanonicalName)
          Compares a JavaModel JavaClass to a Class.
private  org.eclipse.persistence.internal.oxm.schema.model.Attribute buildAttribute(Property property, org.eclipse.persistence.internal.oxm.schema.model.Schema schema)
          Build an Attribute based on a given Property.
private  org.eclipse.persistence.internal.oxm.schema.model.Attribute buildAttribute(javax.xml.namespace.QName attributeName, java.lang.String typeName)
          Build an Attribute with name and type set.
private  org.eclipse.persistence.internal.oxm.schema.model.Element buildElement(Property property, boolean isAll, org.eclipse.persistence.internal.oxm.schema.model.Schema schema, TypeInfo typeInfo)
          Build an Element based on a given Property.
private  org.eclipse.persistence.internal.oxm.schema.model.Element buildElement(java.lang.String elementName, java.lang.String elementType, boolean isAll)
          Build an Element with name, type and possibly minOccurs set.
protected  SchemaGenerator.AddToSchemaResult buildSchemaComponentsForXPath(org.eclipse.persistence.internal.oxm.XPathFragment frag, SchemaGenerator.AddToSchemaResult xpr, boolean isChoice, Property next)
          This method will build element/complexType/typedefparticle components for a given xml-path, and return an XmlPathResult instance containg the sequence that the target should be added to, as well as the current schema - which could be different than the working schema used before calling this method in the case of a prefixed path element from a different namespace.
 org.eclipse.persistence.internal.oxm.schema.model.Attribute createGlobalAttribute(org.eclipse.persistence.internal.oxm.XPathFragment frag, org.eclipse.persistence.internal.oxm.schema.model.Schema workingSchema, org.eclipse.persistence.internal.oxm.schema.model.Schema fragSchema, Property prop)
          Create a global attribute.
 org.eclipse.persistence.internal.oxm.schema.model.Element createGlobalElement(org.eclipse.persistence.internal.oxm.XPathFragment frag, org.eclipse.persistence.internal.oxm.schema.model.Schema workingSchema, org.eclipse.persistence.internal.oxm.schema.model.Schema fragSchema, boolean isChoice, boolean isUnbounded, Property prop, boolean shouldSetType)
          Create a global element.
 org.eclipse.persistence.internal.oxm.schema.model.Attribute createRefAttribute(java.lang.String attributeRefName, org.eclipse.persistence.internal.oxm.schema.model.ComplexType owningComplexType)
          Create an attribute reference and add it to a given complex type.
 org.eclipse.persistence.internal.oxm.schema.model.Element createRefElement(java.lang.String elementRefName, org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle particle)
          Create an element reference and add it to a given particle.
protected  org.eclipse.persistence.internal.oxm.schema.model.Element elementExistsInParticle(java.lang.String elementName, java.lang.String refString, org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle particle)
          Convenience method for determining if an element already exists in a given typedefparticle.
 org.eclipse.persistence.internal.oxm.schema.model.Schema generateSchema(java.util.ArrayList<JavaClass> typeInfoClasses, java.util.HashMap<java.lang.String,TypeInfo> typeInfo, java.util.HashMap<java.lang.String,javax.xml.namespace.QName> userDefinedSchemaTypes, java.util.HashMap<java.lang.String,PackageInfo> packageToPackageInfoMappings, java.util.HashMap<javax.xml.namespace.QName,ElementDeclaration> additionalGlobalElements, java.util.Map<java.lang.String,java.lang.Class> arrayClassesToGeneratedClasses)
           
 org.eclipse.persistence.internal.oxm.schema.model.Schema generateSchema(java.util.ArrayList<JavaClass> typeInfoClasses, java.util.HashMap<java.lang.String,TypeInfo> typeInfo, java.util.HashMap<java.lang.String,javax.xml.namespace.QName> userDefinedSchemaTypes, java.util.HashMap<java.lang.String,PackageInfo> packageToPackageInfoMappings, java.util.HashMap<javax.xml.namespace.QName,ElementDeclaration> additionalGlobalElements, java.util.Map<java.lang.String,java.lang.Class> arrayClassesToGeneratedClasses, javax.xml.bind.SchemaOutputResolver outputResolver)
           
 java.util.Collection<org.eclipse.persistence.internal.oxm.schema.model.Schema> getAllSchemas()
           
 java.util.ArrayList<java.lang.String> getEnumerationFacetsFor(EnumTypeInfo info)
           
 NamespaceInfo getNamespaceInfoForNamespace(java.lang.String namespace)
           
 java.lang.String getOrGeneratePrefixForNamespace(java.lang.String URI, org.eclipse.persistence.internal.oxm.schema.model.Schema schema)
          Attempt to resolve the given URI to a prefix.
 java.lang.String getPrefixForNamespace(org.eclipse.persistence.internal.oxm.schema.model.Schema schema, java.lang.String URI)
           
private  java.lang.String getQualifiedTypeName(Property prop, org.eclipse.persistence.internal.oxm.schema.model.Schema schema)
          Return the qualified (if necessary) type name for a given Property.
private  org.eclipse.persistence.internal.oxm.schema.model.Schema getSchemaForNamespace(java.lang.String namespace)
          Return the Schema for a given namespace.
 javax.xml.namespace.QName getSchemaTypeFor(JavaClass javaClass)
          Return the schema type (as QName) based on a given JavaClass.
 java.util.HashMap<java.lang.String,SchemaTypeInfo> getSchemaTypeInfo()
          Return the Map of SchemaTypeInfo instances.
 java.lang.String getSchemaTypeNameForClassName(java.lang.String className)
           
private  java.lang.String getTypeName(Property next, JavaClass javaType, org.eclipse.persistence.internal.oxm.schema.model.Schema theSchema)
          Return the type name for a given Property.
private  java.lang.String getTypeNameForElement(Property property, org.eclipse.persistence.internal.oxm.schema.model.Schema schema, JavaClass javaClass, org.eclipse.persistence.internal.oxm.schema.model.Element element)
          Return the type name for an Element based on a given property.
 Property getXmlValueFieldForSimpleContent(TypeInfo info)
           
private  boolean importExists(org.eclipse.persistence.internal.oxm.schema.model.Schema schema, java.lang.String schemaName)
           
 boolean isCollectionType(Property field)
          Indicates if a given Property is a collection type.
 void populateSchemaTypes()
           
private  boolean shouldAddRefAndSetForm(org.eclipse.persistence.internal.oxm.schema.model.SimpleComponent sc, java.lang.String simpleComponentNamespace, java.lang.String lookupNamespace, boolean formQualified, boolean isElement)
           

 

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

 

Field Detail

schemaForNamespace

private java.util.HashMap<java.lang.String,org.eclipse.persistence.internal.oxm.schema.model.Schema> schemaForNamespace

allSchemas

private java.util.List<org.eclipse.persistence.internal.oxm.schema.model.Schema> allSchemas

schema

private org.eclipse.persistence.internal.oxm.schema.model.Schema schema

schemaCount

private int schemaCount

helper

private Helper helper

typeInfo

private java.util.HashMap<java.lang.String,TypeInfo> typeInfo

packageToPackageInfoMappings

private java.util.HashMap<java.lang.String,PackageInfo> packageToPackageInfoMappings

schemaTypeInfo

private java.util.HashMap<java.lang.String,SchemaTypeInfo> schemaTypeInfo

userDefinedSchemaTypes

private java.util.HashMap<java.lang.String,javax.xml.namespace.QName> userDefinedSchemaTypes

arrayClassesToGeneratedClasses

private java.util.Map<java.lang.String,java.lang.Class> arrayClassesToGeneratedClasses

JAVAX_ACTIVATION_DATAHANDLER

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

JAVAX_MAIL_INTERNET_MIMEMULTIPART

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

SWA_REF_IMPORT

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

BUILD_FIELD_VALUE_METHOD

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

COLON

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

ATT

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

EMPTY_STRING

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

DOT

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

SKIP

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

ENTRY

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

DEFAULT

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

GENERATE

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

SCHEMA

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

SCHEMA_EXT

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

OBJECT_CLASSNAME

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

ID

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

IDREF

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

DOT_CHAR

private static final java.lang.Character DOT_CHAR

SLASH

private static final java.lang.Character SLASH

SLASHES

private static final java.lang.Character SLASHES

outputResolver

private javax.xml.bind.SchemaOutputResolver outputResolver

Constructor Detail

SchemaGenerator

public SchemaGenerator(Helper helper)

Method Detail

generateSchema

public org.eclipse.persistence.internal.oxm.schema.model.Schema generateSchema(java.util.ArrayList<JavaClass> typeInfoClasses,
                                                                               java.util.HashMap<java.lang.String,TypeInfo> typeInfo,
                                                                               java.util.HashMap<java.lang.String,javax.xml.namespace.QName> userDefinedSchemaTypes,
                                                                               java.util.HashMap<java.lang.String,PackageInfo> packageToPackageInfoMappings,
                                                                               java.util.HashMap<javax.xml.namespace.QName,ElementDeclaration> additionalGlobalElements,
                                                                               java.util.Map<java.lang.String,java.lang.Class> arrayClassesToGeneratedClasses,
                                                                               javax.xml.bind.SchemaOutputResolver outputResolver)

generateSchema

public org.eclipse.persistence.internal.oxm.schema.model.Schema generateSchema(java.util.ArrayList<JavaClass> typeInfoClasses,
                                                                               java.util.HashMap<java.lang.String,TypeInfo> typeInfo,
                                                                               java.util.HashMap<java.lang.String,javax.xml.namespace.QName> userDefinedSchemaTypes,
                                                                               java.util.HashMap<java.lang.String,PackageInfo> packageToPackageInfoMappings,
                                                                               java.util.HashMap<javax.xml.namespace.QName,ElementDeclaration> additionalGlobalElements,
                                                                               java.util.Map<java.lang.String,java.lang.Class> arrayClassesToGeneratedClasses)

addSchemaComponents

public void addSchemaComponents(JavaClass myClass)

addToSchemaType

public void addToSchemaType(TypeInfo ownerTypeInfo,
                            java.util.List<Property> properties,
                            org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor,
                            org.eclipse.persistence.internal.oxm.schema.model.ComplexType type,
                            org.eclipse.persistence.internal.oxm.schema.model.Schema workingSchema)

getSchemaTypeFor

public javax.xml.namespace.QName getSchemaTypeFor(JavaClass javaClass)
Return the schema type (as QName) based on a given JavaClass.
Parameters:
javaClass -
Returns:

populateSchemaTypes

public void populateSchemaTypes()

getSchemaTypeNameForClassName

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

getEnumerationFacetsFor

public java.util.ArrayList<java.lang.String> getEnumerationFacetsFor(EnumTypeInfo info)

getXmlValueFieldForSimpleContent

public Property getXmlValueFieldForSimpleContent(TypeInfo info)

isCollectionType

public boolean isCollectionType(Property field)
Indicates if a given Property is a collection type.
Parameters:
field -
Returns:

getSchemaForNamespace

private org.eclipse.persistence.internal.oxm.schema.model.Schema getSchemaForNamespace(java.lang.String namespace)
Return the Schema for a given namespace. If no schema exists for the given namespace, one will be created.
Parameters:
namespace -
Returns:

getAllSchemas

public java.util.Collection<org.eclipse.persistence.internal.oxm.schema.model.Schema> getAllSchemas()

getNamespaceInfoForNamespace

public NamespaceInfo getNamespaceInfoForNamespace(java.lang.String namespace)

getPrefixForNamespace

public java.lang.String getPrefixForNamespace(org.eclipse.persistence.internal.oxm.schema.model.Schema schema,
                                              java.lang.String URI)

getOrGeneratePrefixForNamespace

public java.lang.String getOrGeneratePrefixForNamespace(java.lang.String URI,
                                                        org.eclipse.persistence.internal.oxm.schema.model.Schema schema)
Attempt to resolve the given URI to a prefix. If this is unsuccessful, one will be generated and added to the resolver.
Parameters:
URI -
schema -
Returns:

addGlobalElements

public void addGlobalElements(java.util.HashMap<javax.xml.namespace.QName,ElementDeclaration> additionalElements)

getSchemaTypeInfo

public java.util.HashMap<java.lang.String,SchemaTypeInfo> getSchemaTypeInfo()
Return the Map of SchemaTypeInfo instances. The Map is keyed on JavaClass qualified name.
Returns:

importExists

private boolean importExists(org.eclipse.persistence.internal.oxm.schema.model.Schema schema,
                             java.lang.String schemaName)

addImportIfRequired

private boolean addImportIfRequired(org.eclipse.persistence.internal.oxm.schema.model.Schema sourceSchema,
                                    org.eclipse.persistence.internal.oxm.schema.model.Schema importSchema,
                                    java.lang.String importNamespace)

areEquals

protected boolean areEquals(JavaClass src,
                            java.lang.String tgtCanonicalName)
Compares a JavaModel JavaClass to a Class. Equality is based on the raw name of the JavaClass compared to the canonical name of the Class.
Parameters:
src -
tgt -
Returns:

areEquals

protected boolean areEquals(JavaClass src,
                            java.lang.Class tgt)
Compares a JavaModel JavaClass to a Class. Equality is based on the raw name of the JavaClass compared to the canonical name of the Class.
Parameters:
src -
tgt -
Returns:

getTypeName

private java.lang.String getTypeName(Property next,
                                     JavaClass javaType,
                                     org.eclipse.persistence.internal.oxm.schema.model.Schema theSchema)
Return the type name for a given Property.
Parameters:
next -
javaType -
theSchema -
Returns:

getQualifiedTypeName

private java.lang.String getQualifiedTypeName(Property prop,
                                              org.eclipse.persistence.internal.oxm.schema.model.Schema schema)
Return the qualified (if necessary) type name for a given Property.
Parameters:
prop -
schema -
Returns:

buildSchemaComponentsForXPath

protected SchemaGenerator.AddToSchemaResult buildSchemaComponentsForXPath(org.eclipse.persistence.internal.oxm.XPathFragment frag,
                                                                          SchemaGenerator.AddToSchemaResult xpr,
                                                                          boolean isChoice,
                                                                          Property next)
This method will build element/complexType/typedefparticle components for a given xml-path, and return an XmlPathResult instance containg the sequence that the target should be added to, as well as the current schema - which could be different than the working schema used before calling this method in the case of a prefixed path element from a different namespace. Regarding the path 'target', if the xml-path was "contact-info/address/street", "street" would be the target. In this case the sequence containing the "address" element would be set in the XmlPathResult to be returned. The exception case is an 'any', where we want to process the last path element before returning - this is necessary due to the fact that an Any will be added to the sequence in place of the last path element by the calling method.
Parameters:
frag -
xpr -
isAny -
isChoice -
Returns:

elementExistsInParticle

protected org.eclipse.persistence.internal.oxm.schema.model.Element elementExistsInParticle(java.lang.String elementName,
                                                                                            java.lang.String refString,
                                                                                            org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle particle)
Convenience method for determining if an element already exists in a given typedefparticle. If an element exists whose ref is equal to 'refString' or its name is equal to 'elementName', it is returned. Null otherwise. Note that ref takes precidence, so if either has a ref set name equality will not be performed.
Parameters:
elementName - the non-null element name to look for
refString - if the element is a ref, this will be the prefix qualified element name
particle - the sequence/choice/all to search for an existing element
Returns:

createGlobalAttribute

public org.eclipse.persistence.internal.oxm.schema.model.Attribute createGlobalAttribute(org.eclipse.persistence.internal.oxm.XPathFragment frag,
                                                                                         org.eclipse.persistence.internal.oxm.schema.model.Schema workingSchema,
                                                                                         org.eclipse.persistence.internal.oxm.schema.model.Schema fragSchema,
                                                                                         Property prop)
Create a global attribute. An import is added if necessary. This method will typically be called when processing an XPath and a prefixed path element is encountered tha requires an attribute ref.
Parameters:
frag -
workingSchema -
fragSchema -
next -
Returns:

createGlobalElement

public org.eclipse.persistence.internal.oxm.schema.model.Element createGlobalElement(org.eclipse.persistence.internal.oxm.XPathFragment frag,
                                                                                     org.eclipse.persistence.internal.oxm.schema.model.Schema workingSchema,
                                                                                     org.eclipse.persistence.internal.oxm.schema.model.Schema fragSchema,
                                                                                     boolean isChoice,
                                                                                     boolean isUnbounded,
                                                                                     Property prop,
                                                                                     boolean shouldSetType)
Create a global element. An import is added if necessary. This method will typically be called when processing an XPath and a prefixed path element is encountered the requires an element ref.
Parameters:
frag - XPathFragment which wil lbe used to create the global element
workingSchema - current schema
fragSchema - frag's schema
isChoice - indicates if we need to construct a choice
isUnbounded - maxOccurs setting for choice
next - property which owns the xml-path
shouldSetType - if this is the last fragment in the xml-path and not an 'any', we should set the type
Returns:

createRefElement

public org.eclipse.persistence.internal.oxm.schema.model.Element createRefElement(java.lang.String elementRefName,
                                                                                  org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle particle)
Create an element reference and add it to a given particle. This method will typically be called when processing an XPath and a prefixed path element is encountered that requires an element ref.
Parameters:
elementRefName -
particle -
Returns:

createRefAttribute

public org.eclipse.persistence.internal.oxm.schema.model.Attribute createRefAttribute(java.lang.String attributeRefName,
                                                                                      org.eclipse.persistence.internal.oxm.schema.model.ComplexType owningComplexType)
Create an attribute reference and add it to a given complex type. This method will typically be called when processing an XPath and a prefixed path element is encountered that requires an attribute ref.
Parameters:
attributeRefName -
owningComplexType -
Returns:

addTransformerToSchema

private void addTransformerToSchema(Property property,
                                    TypeInfo typeInfo,
                                    org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor,
                                    org.eclipse.persistence.internal.oxm.schema.model.ComplexType type,
                                    org.eclipse.persistence.internal.oxm.schema.model.Schema schema)
Convenience method for processing XmlWriteTransformer(s) for a given property. Required schema components will be generated and set accordingly.
Parameters:
property - the property containing one or more XmlWriteTransformers.
typeInfo - the TypeInfo that owns the property
compositor - sequence/choice/all to modify
type - ComplexType which compositor(s) should be added to
schema - current schema which ComplextType will be added to

addXPathToSchema

private SchemaGenerator.AddToSchemaResult addXPathToSchema(Property property,
                                                           org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor,
                                                           org.eclipse.persistence.internal.oxm.schema.model.Schema schema,
                                                           boolean isChoice,
                                                           org.eclipse.persistence.internal.oxm.schema.model.ComplexType type)
Process a given XmlPath, and create the required schema components. The last fragment may not be processed; in this case the returned XmlPathResult is used to set the current schema and parent complex type, then the owning property is processed as per usual. Note the last fragment may be processed if it has a namespace or is an 'any'.
Parameters:
property - the property containing the XmlPath for which schema components are to be built
compositor - the sequence/choice/all to modify
schema - the schema being built when this method is called - this could if the XmlPath contains an entry that references a different namespace
isChoice - indicates if the given property is a choice property
type - the ComplexType which compositor(s) should be added to
Returns:
AddToSchemaResult containing current schema and sequence/all/choice build based on the given XmlPath

addXmlElementWrapperToSchema

private SchemaGenerator.AddToSchemaResult addXmlElementWrapperToSchema(Property property,
                                                                       org.eclipse.persistence.internal.oxm.schema.model.Schema schema,
                                                                       org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor)
Convenience method for processing an XmlElementWrapper for a given property. Required schema components will be generated and set accordingly.
Parameters:
property - the property containing an XmlElementWrapper
schema - the schema currently being generated
compositor - sequence/choice/all that the generated wrapper Element will be added to
Returns:
AddToSchemaResult containing current ComplexType and TypeDefParticle

buildAttribute

private org.eclipse.persistence.internal.oxm.schema.model.Attribute buildAttribute(javax.xml.namespace.QName attributeName,
                                                                                   java.lang.String typeName)
Build an Attribute with name and type set. This method will typically be called when processing an XPath that has no associated Property that can be used to build an Attribute, such as in the case of XmlJoinNodes.
Parameters:
attributeName - name of the Attribute
typeName - type of the Attribute
Returns:

buildAttribute

private org.eclipse.persistence.internal.oxm.schema.model.Attribute buildAttribute(Property property,
                                                                                   org.eclipse.persistence.internal.oxm.schema.model.Schema schema)
Build an Attribute based on a given Property.
Parameters:
property - the Property used to build the Attribute
schema - the schema currently being generated
Returns:

addAttributeToSchema

private void addAttributeToSchema(org.eclipse.persistence.internal.oxm.schema.model.Attribute attribute,
                                  javax.xml.namespace.QName attributeName,
                                  org.eclipse.persistence.internal.oxm.schema.model.Schema schema,
                                  org.eclipse.persistence.internal.oxm.schema.model.ComplexType type)
Convenience method for processing an attribute property. Required schema components will be generated and set accordingly.
Parameters:
property - the attribute property to be processed
schema - the schema currently being generated
type - the ComplexType which compositor(s) should be added to

shouldAddRefAndSetForm

private boolean shouldAddRefAndSetForm(org.eclipse.persistence.internal.oxm.schema.model.SimpleComponent sc,
                                       java.lang.String simpleComponentNamespace,
                                       java.lang.String lookupNamespace,
                                       boolean formQualified,
                                       boolean isElement)

addAnyAttributeToSchema

private void addAnyAttributeToSchema(org.eclipse.persistence.internal.oxm.schema.model.ComplexType type)
Convenience method for processing an any attribute property. Required schema components will be generated and set accordingly.
Parameters:
type - the ComplexType which compositor(s) should be added to

addAnyToSchema

private void addAnyToSchema(Property property,
                            org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor)
Convenience method for processing an any property. Required schema components will be generated and set accordingly.
Parameters:
property - the choice property to be processed
compositor - the sequence/choice/all to modify

addAnyToSchema

private void addAnyToSchema(Property property,
                            org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor,
                            boolean isCollection)
Convenience method for processing an any property. Required schema components will be generated and set accordingly.
Parameters:
property - the choice property to be processed
compositor - the sequence/choice/all to modify
isCollection - if true will be unbounded

addAnyToSchema

private void addAnyToSchema(Property property,
                            org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor,
                            boolean isCollection,
                            java.lang.String anyNamespace)
Convenience method for processing an any property. Required schema components will be generated and set accordingly.
Parameters:
property - the choice property to be processed
compositor - the sequence/choice/all to modify
isCollection - if true will be unbounded
anyNamespace - value for the Any's namespace attribute

addChoiceToSchema

private void addChoiceToSchema(Property property,
                               TypeInfo typeInfo,
                               org.eclipse.persistence.internal.oxm.schema.model.ComplexType type,
                               org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor,
                               org.eclipse.persistence.internal.oxm.schema.model.Schema schema)
Convenience method for processing a choice property. Required schema components will be generated and set accordingly.
Parameters:
property - the choice property to be processed
typeInfo - the TypeInfo that the given property belongs to
type - the ComplexType which compositor(s) should be added to
compositor - the sequence/choice/all to modify
schema - the schema being built

addReferenceToSchema

private void addReferenceToSchema(Property property,
                                  org.eclipse.persistence.internal.oxm.schema.model.Schema schema,
                                  org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor)
Convenience method for processing a reference property. Required schema components will be generated and set accordingly.
Parameters:
property - the choice property to be processed
compositor - the sequence/choice/all to modify
schema - the schema being built

addMapToSchema

private void addMapToSchema(Property property,
                            org.eclipse.persistence.internal.oxm.schema.model.Element element,
                            org.eclipse.persistence.internal.oxm.schema.model.Schema schema,
                            TypeInfo typeInfo)
Convenience method for processing a reference property. Required schema components will be generated and set accordingly.
Parameters:
property - the map property to be processed
element - schema Element a new complex type will be added to
schema - the schema being built
typeInfo - the TypeInfo that the given property belongs to

addElementRefToSchema

private void addElementRefToSchema(org.eclipse.persistence.internal.oxm.schema.model.Schema schema,
                                   org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor,
                                   org.eclipse.persistence.internal.oxm.schema.model.Element referencedElement,
                                   java.lang.String referencedElementURI)
Convenience method that adds an element ref to a given schema.
Parameters:
schema - the schema being built
compositor - the sequence/choice/all the new reference will be added to
referencedElement - the element being referenced
referencedElementURI - the URI of the element being referenced

buildElement

private org.eclipse.persistence.internal.oxm.schema.model.Element buildElement(java.lang.String elementName,
                                                                               java.lang.String elementType,
                                                                               boolean isAll)
Build an Element with name, type and possibly minOccurs set. This method will typically be called when processing an XPath that has no associated Property that can be used to build an Element, such as in the case of XmlJoinNodes.
Parameters:
elementName - name of the Element
elementType - type of the Element
isAll - indicates if the Element will be added to an All structure
Returns:

buildElement

private org.eclipse.persistence.internal.oxm.schema.model.Element buildElement(Property property,
                                                                               boolean isAll,
                                                                               org.eclipse.persistence.internal.oxm.schema.model.Schema schema,
                                                                               TypeInfo typeInfo)
Build an Element based on a given Property.
Parameters:
property - the Property used to build the Element
isAll - true if the Element will be added to an All structure
schema - the schema currently being built
typeInfo - the TypeInfo that owns the given Property
Returns:

addElementToSchema

private void addElementToSchema(org.eclipse.persistence.internal.oxm.schema.model.Element element,
                                java.lang.String elementURI,
                                boolean isPositional,
                                org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor,
                                org.eclipse.persistence.internal.oxm.schema.model.Schema schema)
Convenience method that adds an element to a given schema.
Parameters:
property - the Property that the Element will be based on
compositor - the sequence/choice/all that the Element will be added to
schema - the schema currently being built
typeInfo - the TypeInfo that owns the given Property

addXmlJoinNodesToSchema

private void addXmlJoinNodesToSchema(Property property,
                                     org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle compositor,
                                     org.eclipse.persistence.internal.oxm.schema.model.Schema schema,
                                     org.eclipse.persistence.internal.oxm.schema.model.ComplexType type)
Convenience method that processes the XmlJoinNodes for a given Property and adds the appropriate components to the schema.
Parameters:
property - the Property contianing one or more XmlJoinNode entries
compositor - the sequence/choice/all that will be added to
schema - the schema currently being built
type - the complex type currently being built

getTypeNameForElement

private java.lang.String getTypeNameForElement(Property property,
                                               org.eclipse.persistence.internal.oxm.schema.model.Schema schema,
                                               JavaClass javaClass,
                                               org.eclipse.persistence.internal.oxm.schema.model.Element element)
Return the type name for an Element based on a given property.
Parameters:
property - the Property that the type name will be based on
schema - the schema currently being built
javaClass - the given Property's 'actual' type
element - the element being generated for the given Property
Returns:
a type name based on the given Property, or null if not obtainable

Skip navigation links

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