org.eclipse.xsd.ecore
Class XSDEcoreBuilder
java.lang.Object
org.eclipse.xsd.ecore.NameMangler
org.eclipse.xsd.ecore.MapBuilder
org.eclipse.xsd.ecore.XSDEcoreBuilder
- public class XSDEcoreBuilder
- extends MapBuilder
Method Summary |
static void |
addToSortedList(List eNamedElements,
ENamedElement eNamedElement)
|
protected static boolean |
canSupportNull(EDataType eDataType)
|
protected void |
checkForPrimitive(EDataType eDataType)
|
protected void |
checkForPrimitive(XSDSimpleTypeDefinition xsdSimpleTypeDefinition,
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 EStructuralFeature |
createFeature(EClass eClass,
XSDAttributeDeclaration xsdAttributeDeclaration,
String name,
XSDComponent xsdComponent,
boolean isRequired)
|
protected EStructuralFeature |
createFeature(EClass eClass,
XSDElementDeclaration xsdElementDeclaration,
String name,
XSDComponent xsdComponent,
int minOccurs,
int maxOccurs)
|
protected ResourceSet |
createResourceSet()
|
protected void |
fixXMLName(EClassifier eClassifier)
|
Collection |
generate(Collection uris)
|
Collection |
generate(URI uri)
|
void |
generate(XSDSchema xsdSchema)
|
Collection |
generateResources(Collection uris)
|
Collection |
generateResources(URI uri)
|
protected List |
getAttributeUses(XSDComplexTypeDefinition xsdComplexTypeDefinition)
|
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 String |
getEcoreAttribute(XSDConcreteComponent xsdConcreteComponent1,
XSDConcreteComponent xsdConcreteComponent2,
String attribute)
|
protected XSDTypeDefinition |
getEcoreTypeQNameAttribute(XSDConcreteComponent xsdConcreteComponent,
Element element,
String namespace,
String attribute)
|
protected XSDTypeDefinition |
getEcoreTypeQNameAttribute(XSDConcreteComponent xsdConcreteComponent,
String attribute)
|
protected List |
getEcoreTypeQNamesAttribute(XSDConcreteComponent xsdConcreteComponent,
Element element,
String namespace,
String attribute)
|
protected List |
getEcoreTypeQNamesAttribute(XSDConcreteComponent xsdConcreteComponent,
String attribute)
|
EDataType |
getEDataType(XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
|
protected XSDTypeDefinition |
getEffectiveTypeDefinition(XSDComponent xsdComponent,
XSDFeature xsdFeature)
|
EPackage |
getEPackage(XSDNamedComponent xsdNamedComponent)
|
EStructuralFeature |
getEStructuralFeature(XSDFeature xsdFeature)
|
protected String |
getInstanceClassName(XSDTypeDefinition xsdTypeDefinition,
EDataType baseEDataType)
|
XSDSchema |
getRootSchema()
|
XSDSchema |
getSchema()
|
Map |
getTargetNamespaceToEPackageMap()
|
protected List |
getWildcards(XSDWildcard xsdWildcard)
|
Map |
getXSDComponentToEModelElementMap()
|
protected void |
handleFacets(XSDSimpleTypeDefinition xsdSimpleTypeDefinition,
EDataType eDataType)
|
protected boolean |
ignore(Attr attribute)
|
protected boolean |
ignore(Element element)
|
protected void |
initialize(EAttribute eAttribute,
XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
|
protected void |
initialize(EStructuralFeature eStructuralFeature,
XSDFeature xsdFeature,
XSDComponent xsdComponent)
|
static boolean |
isLocalReferenceType(XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
|
protected void |
populateETypedElement(ETypedElement eTypedElement,
Element element)
|
protected void |
populateTypeToTypeObjectMap(EPackage ePackage)
|
protected void |
reorderAttributeUses(List attributeUses,
List attributeContents)
|
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)
|
protected boolean |
useSortedAttributes()
|
protected String |
validAliasName(XSDTypeDefinition xsdTypeDefinition,
boolean isUpperCase)
|
protected void |
validate(XSDSchema xsdSchema)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
typeToTypeObjectMap
protected Map typeToTypeObjectMap
PRIMITIVES
protected static final List PRIMITIVES
PRIMITIVE_WRAPPERS
protected static final String[] PRIMITIVE_WRAPPERS
ECORE_PRIMITIVE_TYPES
protected static final Map ECORE_PRIMITIVE_TYPES
ANY_NAMESPACE_WILDCARD
protected final List ANY_NAMESPACE_WILDCARD
NOT_NULL_WILDCARD
protected final List NOT_NULL_WILDCARD
ecoreResourceFactoryImplClass
protected static final Class ecoreResourceFactoryImplClass
XSDEcoreBuilder
public XSDEcoreBuilder()
XSDEcoreBuilder
public XSDEcoreBuilder(ExtendedMetaData extendedMetaData)
populateTypeToTypeObjectMap
protected void populateTypeToTypeObjectMap(EPackage ePackage)
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)
getInstanceClassName
protected String getInstanceClassName(XSDTypeDefinition xsdTypeDefinition,
EDataType baseEDataType)
validAliasName
protected String validAliasName(XSDTypeDefinition xsdTypeDefinition,
boolean isUpperCase)
canSupportNull
protected static boolean canSupportNull(EDataType eDataType)
checkForPrimitive
protected void checkForPrimitive(XSDSimpleTypeDefinition xsdSimpleTypeDefinition,
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)
populateETypedElement
protected void populateETypedElement(ETypedElement eTypedElement,
Element element)
useSortedAttributes
protected boolean useSortedAttributes()
getAttributeUses
protected List getAttributeUses(XSDComplexTypeDefinition xsdComplexTypeDefinition)
reorderAttributeUses
protected void reorderAttributeUses(List attributeUses,
List attributeContents)
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)
getEffectiveTypeDefinition
protected XSDTypeDefinition getEffectiveTypeDefinition(XSDComponent xsdComponent,
XSDFeature xsdFeature)
createFeature
protected EStructuralFeature createFeature(EClass eClass,
XSDElementDeclaration xsdElementDeclaration,
String name,
XSDComponent xsdComponent,
int minOccurs,
int maxOccurs)
createFeature
protected EStructuralFeature createFeature(EClass eClass,
XSDAttributeDeclaration xsdAttributeDeclaration,
String name,
XSDComponent xsdComponent,
boolean isRequired)
initialize
protected void initialize(EStructuralFeature eStructuralFeature,
XSDFeature xsdFeature,
XSDComponent xsdComponent)
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)
fixXMLName
protected void fixXMLName(EClassifier eClassifier)
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)
getEcoreAttribute
protected String getEcoreAttribute(XSDConcreteComponent xsdConcreteComponent1,
XSDConcreteComponent xsdConcreteComponent2,
String attribute)
getEcoreAttribute
protected String getEcoreAttribute(XSDConcreteComponent xsdConcreteComponent,
String attribute)
getEcoreAttribute
protected String getEcoreAttribute(Element element,
String attribute)
getEcoreTypeQNameAttribute
protected XSDTypeDefinition getEcoreTypeQNameAttribute(XSDConcreteComponent xsdConcreteComponent,
String attribute)
getEcoreTypeQNameAttribute
protected XSDTypeDefinition getEcoreTypeQNameAttribute(XSDConcreteComponent xsdConcreteComponent,
Element element,
String namespace,
String attribute)
getEcoreTypeQNamesAttribute
protected List getEcoreTypeQNamesAttribute(XSDConcreteComponent xsdConcreteComponent,
String attribute)
getEcoreTypeQNamesAttribute
protected List getEcoreTypeQNamesAttribute(XSDConcreteComponent xsdConcreteComponent,
Element element,
String namespace,
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)
ignore
protected boolean ignore(Element element)
ignore
protected boolean ignore(Attr attribute)
validate
protected void validate(XSDSchema xsdSchema)