org.eclipse.xsd.ecore
Class XSDEcoreBuilder

java.lang.Object
  extended byorg.eclipse.xsd.ecore.MapBuilder
      extended byorg.eclipse.xsd.ecore.XSDEcoreBuilder

public class XSDEcoreBuilder
extends MapBuilder


Nested Class Summary
static class XSDEcoreBuilder.Comparator
           
static class XSDEcoreBuilder.EffectiveOccurrence
           
 
Nested classes inherited from class org.eclipse.xsd.ecore.MapBuilder
MapBuilder.Mapper
 
Field Summary
protected  List ANY_NAMESPACE_WILDCARD
           
protected  List diagnostics
           
protected static List DOMAINS
           
protected  Map eReferenceToOppositeNameMap
           
protected  ExtendedMetaData extendedMetaData
           
protected  List NOT_NULL_WILDCARD
           
protected static String[] PRIMITIVE_WRAPPERS
           
protected static List PRIMITIVES
           
protected  XSDSchema rootSchema
           
protected  List simpleDiagnostics
           
protected  Map targetNamespaceToEPackageMap
           
protected  List xsdSchemas
           
 
Fields inherited from class org.eclipse.xsd.ecore.MapBuilder
mapper, xsdComponentToEModelElementMap
 
Constructor Summary
XSDEcoreBuilder()
           
XSDEcoreBuilder(ExtendedMetaData extendedMetaData)
           
 
Method Summary
static void addToSortedList(List eNamedElements, ENamedElement eNamedElement)
           
protected static boolean canSupportNull(EDataType eDataType)
           
protected  void checkForPrimitive(EDataType eDataType)
           
 List collectParticles(XSDParticle xsdParticle)
           
 void collectParticlesHelper(List result, XSDParticle xsdParticle, int minOccurs, int maxOccurs, XSDModelGroup target)
           
 EClass computeEClass(XSDComplexTypeDefinition xsdComplexTypeDefinition)
           
protected  EClassifier computeEClassifier(XSDTypeDefinition xsdTypeDefinition)
           
protected  EDataType computeEDataType(XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
           
protected  EEnum computeEEnum(XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
           
protected  EStructuralFeature createFeature(EClass eClass, String name, EClassifier type, XSDComponent xsdComponent)
           
protected  EStructuralFeature createFeature(EClass eClass, String name, EClassifier type, XSDComponent xsdComponent, int minOccurs, int maxOccurs)
           
protected  ResourceSet createResourceSet()
           
 Collection generate(Collection uris)
           
 Collection generate(URI uri)
           
 void generate(XSDSchema xsdSchema)
           
 Collection generateResources(Collection uris)
           
 Collection generateResources(URI uri)
           
protected  EClassifier getBuiltInEClassifier(String namespace, String name)
           
 List getDiagnostics()
           
 EClass getEClass(XSDComplexTypeDefinition xsdComplexTypeDefinition)
           
 EClassifier getEClassifier(XSDTypeDefinition xsdTypeDefinition)
           
protected  String getEcoreAttribute(Element element, String attribute)
           
protected  String getEcoreAttribute(XSDConcreteComponent xsdConcreteComponent, String attribute)
           
protected  XSDTypeDefinition getEcoreTypeQNameAttribute(XSDConcreteComponent xsdConcreteComponent, String attribute)
           
 EDataType getEDataType(XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
           
 EPackage getEPackage(XSDNamedComponent xsdNamedComponent)
           
 EStructuralFeature getEStructuralFeature(XSDFeature xsdFeature)
           
 XSDSchema getRootSchema()
           
 XSDSchema getSchema()
           
 Map getTargetNamespaceToEPackageMap()
           
protected  List getWildcards(XSDWildcard xsdWildcard)
           
 Map getXSDComponentToEModelElementMap()
           
protected  void handleFacets(XSDSimpleTypeDefinition xsdSimpleTypeDefinition, EDataType eDataType)
           
protected  void initialize(EAttribute eAttribute, XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
           
static boolean isLocalReferenceType(XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
           
protected  List parseName(String sourceName, char separator)
           
protected  void resolveNameConflict(Map map, ENamedElement eNamedElement, String suffix)
           
protected  void resolveNameConflicts()
           
protected  void setAnnotations(EModelElement eModelElement, XSDConcreteComponent xsdComponent)
           
 void setValidate(boolean validate)
           
static List sortNamedComponents(Collection eNamedElements)
           
 String uncapName(String name)
           
protected  void validate(XSDSchema xsdSchema)
           
protected  String validName(String name, boolean isUpperCase)
           
 
Methods inherited from class org.eclipse.xsd.ecore.MapBuilder
addInput, addOutput, map, setMapper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rootSchema

protected XSDSchema rootSchema

simpleDiagnostics

protected List simpleDiagnostics

diagnostics

protected List diagnostics

xsdSchemas

protected List xsdSchemas

targetNamespaceToEPackageMap

protected Map targetNamespaceToEPackageMap

extendedMetaData

protected ExtendedMetaData extendedMetaData

eReferenceToOppositeNameMap

protected Map eReferenceToOppositeNameMap

DOMAINS

protected static final List DOMAINS

PRIMITIVES

protected static final List PRIMITIVES

PRIMITIVE_WRAPPERS

protected static final String[] PRIMITIVE_WRAPPERS

ANY_NAMESPACE_WILDCARD

protected final List ANY_NAMESPACE_WILDCARD

NOT_NULL_WILDCARD

protected final List NOT_NULL_WILDCARD
Constructor Detail

XSDEcoreBuilder

public XSDEcoreBuilder()

XSDEcoreBuilder

public XSDEcoreBuilder(ExtendedMetaData extendedMetaData)
Method Detail

getSchema

public XSDSchema getSchema()

setValidate

public void setValidate(boolean validate)

getDiagnostics

public List getDiagnostics()

getRootSchema

public XSDSchema getRootSchema()

getTargetNamespaceToEPackageMap

public Map getTargetNamespaceToEPackageMap()

getXSDComponentToEModelElementMap

public Map getXSDComponentToEModelElementMap()

getEPackage

public EPackage getEPackage(XSDNamedComponent xsdNamedComponent)

getEClassifier

public EClassifier getEClassifier(XSDTypeDefinition xsdTypeDefinition)

getEDataType

public EDataType getEDataType(XSDSimpleTypeDefinition xsdSimpleTypeDefinition)

getEClass

public EClass getEClass(XSDComplexTypeDefinition xsdComplexTypeDefinition)

getBuiltInEClassifier

protected EClassifier getBuiltInEClassifier(String namespace,
                                            String name)

computeEClassifier

protected EClassifier computeEClassifier(XSDTypeDefinition xsdTypeDefinition)

computeEDataType

protected EDataType computeEDataType(XSDSimpleTypeDefinition xsdSimpleTypeDefinition)

canSupportNull

protected static boolean canSupportNull(EDataType eDataType)

checkForPrimitive

protected void checkForPrimitive(EDataType eDataType)

handleFacets

protected void handleFacets(XSDSimpleTypeDefinition xsdSimpleTypeDefinition,
                            EDataType eDataType)

computeEEnum

protected EEnum computeEEnum(XSDSimpleTypeDefinition xsdSimpleTypeDefinition)

computeEClass

public EClass computeEClass(XSDComplexTypeDefinition xsdComplexTypeDefinition)

getWildcards

protected List getWildcards(XSDWildcard xsdWildcard)

createFeature

protected EStructuralFeature createFeature(EClass eClass,
                                           String name,
                                           EClassifier type,
                                           XSDComponent xsdComponent)

createFeature

protected EStructuralFeature createFeature(EClass eClass,
                                           String name,
                                           EClassifier type,
                                           XSDComponent xsdComponent,
                                           int minOccurs,
                                           int maxOccurs)

initialize

protected void initialize(EAttribute eAttribute,
                          XSDSimpleTypeDefinition xsdSimpleTypeDefinition)

collectParticles

public List collectParticles(XSDParticle xsdParticle)

collectParticlesHelper

public void collectParticlesHelper(List result,
                                   XSDParticle xsdParticle,
                                   int minOccurs,
                                   int maxOccurs,
                                   XSDModelGroup target)

resolveNameConflicts

protected void resolveNameConflicts()

resolveNameConflict

protected void resolveNameConflict(Map map,
                                   ENamedElement eNamedElement,
                                   String suffix)

createResourceSet

protected ResourceSet createResourceSet()

generateResources

public Collection generateResources(URI uri)

generateResources

public Collection generateResources(Collection uris)

getEStructuralFeature

public EStructuralFeature getEStructuralFeature(XSDFeature xsdFeature)

generate

public Collection generate(URI uri)

generate

public Collection generate(Collection uris)

generate

public void generate(XSDSchema xsdSchema)

validName

protected String validName(String name,
                           boolean isUpperCase)

parseName

protected List parseName(String sourceName,
                         char separator)

uncapName

public String uncapName(String name)

getEcoreAttribute

protected String getEcoreAttribute(XSDConcreteComponent xsdConcreteComponent,
                                   String attribute)

getEcoreAttribute

protected String getEcoreAttribute(Element element,
                                   String attribute)

getEcoreTypeQNameAttribute

protected XSDTypeDefinition getEcoreTypeQNameAttribute(XSDConcreteComponent xsdConcreteComponent,
                                                       String attribute)

sortNamedComponents

public static List sortNamedComponents(Collection eNamedElements)

addToSortedList

public static void addToSortedList(List eNamedElements,
                                   ENamedElement eNamedElement)

isLocalReferenceType

public static boolean isLocalReferenceType(XSDSimpleTypeDefinition xsdSimpleTypeDefinition)

setAnnotations

protected void setAnnotations(EModelElement eModelElement,
                              XSDConcreteComponent xsdComponent)

validate

protected void validate(XSDSchema xsdSchema)

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