org.eclipse.xsd.ecore
Class EcoreSchemaBuilder

java.lang.Object
  extended by org.eclipse.xsd.ecore.NameMangler
      extended by org.eclipse.xsd.ecore.MapBuilder
          extended by org.eclipse.xsd.ecore.EcoreSchemaBuilder

public class EcoreSchemaBuilder
extends MapBuilder

This class produces an XSDSchema given an Ecore EPackage.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.xsd.ecore.MapBuilder
MapBuilder.Mapper
 
Field Summary
protected  java.lang.String defaultXMLSchemaNamespace
          The schema for schema namespace version to be used for new schemas.
protected  java.lang.String defaultXMLSchemaNamespacePrefix
          The prefix to be used for the schema for schema namespace version in new schemas.
protected  java.util.Map<org.eclipse.emf.ecore.EModelElement,XSDComponent> eModelElementToXSDComponentMap
          Store the reverse map too.
protected  org.eclipse.emf.ecore.util.ExtendedMetaData extendedMetaData
          The extended meta data used to determine the schema structure.
protected static java.lang.String GEN_MODEL_PACKAGE_NS_URI
           
 
Fields inherited from class org.eclipse.xsd.ecore.MapBuilder
mapper, xsdComponentToEModelElementMap
 
Fields inherited from class org.eclipse.xsd.ecore.NameMangler
DOMAINS, LOWER_CASE, UNCHANGED_CASE, UPPER_CASE
 
Constructor Summary
EcoreSchemaBuilder(org.eclipse.emf.ecore.util.ExtendedMetaData extendedMetaData)
           
 
Method Summary
protected  void buildAnnotation(org.eclipse.emf.ecore.EModelElement eModelElement, org.w3c.dom.Element parent)
           
protected  XSDAnnotation buildAnnotation(XSDConcreteComponent xsdComponent, org.eclipse.emf.ecore.EModelElement eModelElement)
           
protected  void buildAnnotations(XSDComponent xsdComponent, org.eclipse.emf.ecore.EModelElement eModelElement)
           
protected  void buildAttributeInformation(XSDComplexTypeDefinition xsdComplexTypeDefinition, java.lang.String name, boolean isRef, org.eclipse.emf.ecore.EClassifier referenceType, XSDComponent xsdComponent, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
           
protected  XSDAttributeUse buildAttributeUse(XSDComplexTypeDefinition xsdComplexTypeDefinition, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
           
protected  XSDWildcard buildAttributeWildcard(XSDComplexTypeDefinition xsdComplexTypeDefinition, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
           
protected  XSDComplexTypeDefinition buildComplexTypeDefinition(XSDSchema xsdSchema, org.eclipse.emf.ecore.EClass eClass)
           
protected  XSDComponent buildContentFeature(XSDComplexTypeDefinition xsdComplexTypeDefinition, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
           
protected  XSDParticle buildElementParticle(XSDComplexTypeDefinition xsdComplexTypeDefinition, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
           
protected  XSDWildcard buildElementWildcard(XSDComplexTypeDefinition xsdComplexTypeDefinition, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
           
protected  XSDAttributeDeclaration buildGlobalAttribute(XSDSchema xsdSchema, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
           
protected  XSDElementDeclaration buildGlobalElement(XSDSchema xsdSchema, org.eclipse.emf.ecore.EClass eClass)
           
protected  XSDElementDeclaration buildGlobalElement(XSDSchema xsdSchema, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
           
protected  XSDFeature buildGlobalFeature(XSDSchema xsdSchema, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
           
protected  XSDModelGroup buildModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition)
           
protected  XSDParticle buildModelGroupParticle(XSDComplexTypeDefinition xsdComplexTypeDefinition, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
           
protected  XSDSchema buildSchema(org.eclipse.emf.ecore.EPackage ePackage)
           
protected  XSDSimpleTypeDefinition buildSimpleContent(XSDComplexTypeDefinition xsdComplexTypeDefinition, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
           
protected  XSDSimpleTypeDefinition buildSimpleTypeDefinition(XSDSchema xsdSchema, org.eclipse.emf.ecore.EDataType eDataType)
           
protected  XSDTypeDefinition buildTypeDefinition(XSDSchema xsdSchema, org.eclipse.emf.ecore.EClassifier eClassifier)
           
protected  void buildTypeParameters(XSDComponent xsdComponent, java.util.List<org.eclipse.emf.ecore.ETypeParameter> eTypeParameters)
           
protected  void createAnnotation(java.util.Map<java.lang.String,java.lang.String> qNamePrefixToNamespaceMap, org.w3c.dom.Element element, java.lang.String namespace, java.lang.String key, java.lang.String value)
           
protected  void createAnnotation(XSDComponent xsdComponent, java.lang.String namespace, java.lang.String key, java.lang.String value)
           
protected  void createEcoreAnnotation(java.util.Map<java.lang.String,java.lang.String> qNamePrefixToNamespaceMap, org.w3c.dom.Element element, java.lang.String key, java.lang.String value)
           
protected  void createEcoreAnnotation(XSDComponent xsdComponent, java.lang.String key, java.lang.String value)
           
protected  void createUserInfo(XSDAnnotation xsdAnnotation, java.lang.String documentation)
           
protected  XSDModelGroup findOrCreateModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition)
           
protected  java.lang.String getGenericType(XSDSchema xsdSchema, org.eclipse.emf.ecore.EGenericType eGenericType)
           
protected  java.lang.String getQualifiedPackageName(org.eclipse.emf.ecore.EPackage ePackage)
           
 XSDSchema getSchema(org.eclipse.emf.ecore.EPackage ePackage)
           
protected  java.lang.String getURI(org.eclipse.emf.ecore.EClassifier eClassifier)
           
protected  java.lang.String getURI(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
           
protected  void handleImport(XSDSchema xsdSchema, XSDNamedComponent xsdNamedComponent)
           
protected  void handleMultiplicity(XSDSchema xsdSchema, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature, XSDAttributeDeclaration xsdAttributeDeclaration, XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
           
protected  void handleMultiplicity(XSDSchema xsdSchema, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature, XSDComponent xsdComponent, XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
           
protected  java.lang.String handlePrefix(java.util.Map<java.lang.String,java.lang.String> namespaces, java.lang.String preferredPrefix, java.lang.String namespace)
           
protected  boolean isIgnoredAnnotationSource(java.lang.String sourceURI)
           
protected  boolean isWrapperType(org.eclipse.emf.ecore.EClassifier eClassifier)
           
protected  void map(XSDComponent xsdComponent, org.eclipse.emf.ecore.EModelElement eModelElement)
           
 
Methods inherited from class org.eclipse.xsd.ecore.MapBuilder
addInput, addOutput, setMapper
 
Methods inherited from class org.eclipse.xsd.ecore.NameMangler
parseName, qualifiedPackageName, uncapName, validName, validName, validName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultXMLSchemaNamespace

protected java.lang.String defaultXMLSchemaNamespace
The schema for schema namespace version to be used for new schemas.


defaultXMLSchemaNamespacePrefix

protected java.lang.String defaultXMLSchemaNamespacePrefix
The prefix to be used for the schema for schema namespace version in new schemas.


extendedMetaData

protected org.eclipse.emf.ecore.util.ExtendedMetaData extendedMetaData
The extended meta data used to determine the schema structure.


eModelElementToXSDComponentMap

protected java.util.Map<org.eclipse.emf.ecore.EModelElement,XSDComponent> eModelElementToXSDComponentMap
Store the reverse map too.


GEN_MODEL_PACKAGE_NS_URI

protected static final java.lang.String GEN_MODEL_PACKAGE_NS_URI
See Also:
Constant Field Values
Constructor Detail

EcoreSchemaBuilder

public EcoreSchemaBuilder(org.eclipse.emf.ecore.util.ExtendedMetaData extendedMetaData)
Method Detail

map

protected void map(XSDComponent xsdComponent,
                   org.eclipse.emf.ecore.EModelElement eModelElement)
Overrides:
map in class MapBuilder

getSchema

public XSDSchema getSchema(org.eclipse.emf.ecore.EPackage ePackage)

getQualifiedPackageName

protected java.lang.String getQualifiedPackageName(org.eclipse.emf.ecore.EPackage ePackage)

buildSchema

protected XSDSchema buildSchema(org.eclipse.emf.ecore.EPackage ePackage)

buildGlobalElement

protected XSDElementDeclaration buildGlobalElement(XSDSchema xsdSchema,
                                                   org.eclipse.emf.ecore.EClass eClass)

buildGlobalFeature

protected XSDFeature buildGlobalFeature(XSDSchema xsdSchema,
                                        org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)

buildGlobalElement

protected XSDElementDeclaration buildGlobalElement(XSDSchema xsdSchema,
                                                   org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)

buildGlobalAttribute

protected XSDAttributeDeclaration buildGlobalAttribute(XSDSchema xsdSchema,
                                                       org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)

buildTypeDefinition

protected XSDTypeDefinition buildTypeDefinition(XSDSchema xsdSchema,
                                                org.eclipse.emf.ecore.EClassifier eClassifier)

buildSimpleTypeDefinition

protected XSDSimpleTypeDefinition buildSimpleTypeDefinition(XSDSchema xsdSchema,
                                                            org.eclipse.emf.ecore.EDataType eDataType)

buildComplexTypeDefinition

protected XSDComplexTypeDefinition buildComplexTypeDefinition(XSDSchema xsdSchema,
                                                              org.eclipse.emf.ecore.EClass eClass)

buildTypeParameters

protected void buildTypeParameters(XSDComponent xsdComponent,
                                   java.util.List<org.eclipse.emf.ecore.ETypeParameter> eTypeParameters)

buildContentFeature

protected XSDComponent buildContentFeature(XSDComplexTypeDefinition xsdComplexTypeDefinition,
                                           org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)

buildModelGroupParticle

protected XSDParticle buildModelGroupParticle(XSDComplexTypeDefinition xsdComplexTypeDefinition,
                                              org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)

buildElementWildcard

protected XSDWildcard buildElementWildcard(XSDComplexTypeDefinition xsdComplexTypeDefinition,
                                           org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)

buildAttributeWildcard

protected XSDWildcard buildAttributeWildcard(XSDComplexTypeDefinition xsdComplexTypeDefinition,
                                             org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)

buildSimpleContent

protected XSDSimpleTypeDefinition buildSimpleContent(XSDComplexTypeDefinition xsdComplexTypeDefinition,
                                                     org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)

buildAttributeUse

protected XSDAttributeUse buildAttributeUse(XSDComplexTypeDefinition xsdComplexTypeDefinition,
                                            org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)

buildAttributeInformation

protected void buildAttributeInformation(XSDComplexTypeDefinition xsdComplexTypeDefinition,
                                         java.lang.String name,
                                         boolean isRef,
                                         org.eclipse.emf.ecore.EClassifier referenceType,
                                         XSDComponent xsdComponent,
                                         org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)

handleMultiplicity

protected void handleMultiplicity(XSDSchema xsdSchema,
                                  org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature,
                                  XSDAttributeDeclaration xsdAttributeDeclaration,
                                  XSDSimpleTypeDefinition xsdSimpleTypeDefinition)

handleMultiplicity

protected void handleMultiplicity(XSDSchema xsdSchema,
                                  org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature,
                                  XSDComponent xsdComponent,
                                  XSDSimpleTypeDefinition xsdSimpleTypeDefinition)

buildElementParticle

protected XSDParticle buildElementParticle(XSDComplexTypeDefinition xsdComplexTypeDefinition,
                                           org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)

findOrCreateModelGroup

protected XSDModelGroup findOrCreateModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition)

buildModelGroup

protected XSDModelGroup buildModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition)

isWrapperType

protected boolean isWrapperType(org.eclipse.emf.ecore.EClassifier eClassifier)

getURI

protected java.lang.String getURI(org.eclipse.emf.ecore.EClassifier eClassifier)

getURI

protected java.lang.String getURI(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)

getGenericType

protected java.lang.String getGenericType(XSDSchema xsdSchema,
                                          org.eclipse.emf.ecore.EGenericType eGenericType)

createEcoreAnnotation

protected void createEcoreAnnotation(XSDComponent xsdComponent,
                                     java.lang.String key,
                                     java.lang.String value)

createEcoreAnnotation

protected void createEcoreAnnotation(java.util.Map<java.lang.String,java.lang.String> qNamePrefixToNamespaceMap,
                                     org.w3c.dom.Element element,
                                     java.lang.String key,
                                     java.lang.String value)

createAnnotation

protected void createAnnotation(XSDComponent xsdComponent,
                                java.lang.String namespace,
                                java.lang.String key,
                                java.lang.String value)

createAnnotation

protected void createAnnotation(java.util.Map<java.lang.String,java.lang.String> qNamePrefixToNamespaceMap,
                                org.w3c.dom.Element element,
                                java.lang.String namespace,
                                java.lang.String key,
                                java.lang.String value)

handleImport

protected void handleImport(XSDSchema xsdSchema,
                            XSDNamedComponent xsdNamedComponent)

handlePrefix

protected java.lang.String handlePrefix(java.util.Map<java.lang.String,java.lang.String> namespaces,
                                        java.lang.String preferredPrefix,
                                        java.lang.String namespace)

isIgnoredAnnotationSource

protected boolean isIgnoredAnnotationSource(java.lang.String sourceURI)

buildAnnotations

protected void buildAnnotations(XSDComponent xsdComponent,
                                org.eclipse.emf.ecore.EModelElement eModelElement)

buildAnnotation

protected XSDAnnotation buildAnnotation(XSDConcreteComponent xsdComponent,
                                        org.eclipse.emf.ecore.EModelElement eModelElement)

createUserInfo

protected void createUserInfo(XSDAnnotation xsdAnnotation,
                              java.lang.String documentation)

buildAnnotation

protected void buildAnnotation(org.eclipse.emf.ecore.EModelElement eModelElement,
                               org.w3c.dom.Element parent)

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.