|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.xsd.presentation.XSDEditor.MapBuilder | +--org.eclipse.xsd.presentation.XSDEditor.EcoreXMLSchemaBuilder
This class produces an XSDSchema given an Ecore EPackage. The XSDSchema is an XML schema.
Field Summary | |
protected java.util.Map |
ecoreToSchemaName
|
protected static java.lang.String |
EMF_SCHEMA_NAME
|
protected static java.lang.String |
EMF_SCHEMA_PREFIX
|
protected static java.lang.String |
EMF_SCHEMA_URI
|
protected XSDSchema |
emfSchema
|
protected org.eclipse.emf.ecore.EPackage |
ePackage
|
protected java.util.Map |
ePackageToXSDSchemaMap
|
protected static java.lang.String |
REFERENCE_TYPE_NAME
|
protected org.eclipse.emf.ecore.xmi.XMLResource.XMLMap |
xmlMap
|
protected XSDSchema |
xsdSchema
|
Fields inherited from class org.eclipse.xsd.presentation.XSDEditor.MapBuilder |
addInputMethod, addOutputMethod, mapMethod, mapper, mappingRoot, xsdComponentToEModelElementMap |
Constructor Summary | |
XSDEditor.EcoreXMLSchemaBuilder()
|
Method Summary | |
protected void |
addEMFSchema()
|
protected void |
addImport(java.lang.String namespace,
java.lang.String schemaLocation)
|
protected void |
additionalProcessing(org.eclipse.emf.ecore.EClass cls,
XSDComplexTypeDefinition xsdComplexTypeDefinition)
|
protected void |
createAttributeDeclaration(org.eclipse.emf.ecore.EAttribute attribute,
XSDComplexTypeDefinition xsdComplexTypeDefinition)
|
protected void |
createAttributeElementDeclaration(org.eclipse.emf.ecore.EAttribute attribute,
XSDComplexTypeDefinition xsdComplexTypeDefinition)
|
protected void |
createEMFSchema()
|
protected XSDModelGroup |
createModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition)
|
protected void |
createOtherSchema(org.eclipse.emf.ecore.EPackage ePackage)
|
protected void |
createSchema()
|
java.util.Collection |
generate(org.eclipse.emf.ecore.EPackage ePackage)
|
java.util.Collection |
generate(org.eclipse.emf.ecore.EPackage ePackage,
org.eclipse.emf.ecore.xmi.XMLResource.XMLMap map)
|
protected java.util.List |
getAllFeatures(org.eclipse.emf.ecore.EClass eClass,
java.util.Set classesToIgnore)
This method returns the list of features for the given class and all inherited features; ignoring features from classes in the classesToIgnore set. |
protected java.util.List |
getFeatures(org.eclipse.emf.ecore.EClass eClass,
java.util.List superClasses)
Return the inherited features from the super classes (except the first one, which is the base type for the generated schema type for the class), and the local features. |
protected org.eclipse.emf.ecore.xmi.XMLResource.XMLInfo |
getInfo(org.eclipse.emf.ecore.ENamedElement element)
Return the XMLInfo object for the given element, if there is one. |
protected XSDModelGroup |
getModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition)
Returns the model group for the given complex type definition. |
protected java.lang.String |
getName(org.eclipse.emf.ecore.ENamedElement element)
Return the given name, or the name from the XMLMap, if there is one. |
protected XSDSimpleTypeDefinition |
getType(org.eclipse.emf.ecore.EDataType dataType)
|
protected boolean |
makeAttributeDeclaration(org.eclipse.emf.ecore.EAttribute attribute)
|
protected boolean |
makeAttributeElementDeclaration()
|
protected boolean |
makeClassElementDeclaration(org.eclipse.emf.ecore.EClass eClass)
|
protected boolean |
makeReferenceAttribute(org.eclipse.emf.ecore.EReference reference)
|
protected void |
makeReferenceAttribute(org.eclipse.emf.ecore.EReference reference,
XSDComplexTypeDefinition xsdComplexTypeDefinition)
|
protected boolean |
makeReferenceElement(org.eclipse.emf.ecore.EReference reference)
|
protected void |
makeReferenceElement(org.eclipse.emf.ecore.EReference reference,
XSDComplexTypeDefinition xsdComplexTypeDefinition)
|
protected boolean |
processAttribute(org.eclipse.emf.ecore.EAttribute attribute)
|
protected void |
processAttribute(org.eclipse.emf.ecore.EAttribute attribute,
XSDComplexTypeDefinition xsdComplexTypeDefinition)
Map each EAttribute to an XML attribute declaration in the complex type corresponding to the class, or an XML element declaration, depending on the multiplicity of the EAttribute. |
protected void |
processClass(org.eclipse.emf.ecore.EClass eClass)
Map each EClass to a schema complex type and an element declaration of that type; the names of the complex type and element declaration are the name of the class. |
protected void |
processClasses()
|
protected void |
processEnum(org.eclipse.emf.ecore.EEnum enum)
Each EEnum is mapped to a schema simple type that restricts the string simple type; the schema type has an enumeration facet for each EEnumLiteral. |
protected void |
processEnums()
|
protected void |
processReference(org.eclipse.emf.ecore.EReference reference,
XSDComplexTypeDefinition xsdComplexTypeDefinition)
|
protected void |
setAttributeElementMultiplicity(org.eclipse.emf.ecore.EAttribute attribute,
XSDParticle particle)
|
protected void |
setAttributeType(org.eclipse.emf.ecore.EAttribute attribute,
XSDAttributeDeclaration attrDecl)
|
protected void |
setDefaultValue(org.eclipse.emf.ecore.EAttribute attribute,
XSDAttributeDeclaration attrDecl)
|
protected void |
setReferenceAttribType(XSDAttributeDeclaration xsdAttributeDeclaration)
|
protected void |
setReferenceElementMultiplicity(org.eclipse.emf.ecore.EReference reference,
XSDParticle particle)
|
protected void |
setReferenceElementType(org.eclipse.emf.ecore.EReference reference,
XSDElementDeclaration xsdElementDeclaration)
|
protected void |
setUseToRequired(org.eclipse.emf.ecore.EAttribute attribute,
XSDAttributeUse attrUse)
|
protected boolean |
skipReference(org.eclipse.emf.ecore.EReference reference)
|
protected XSDTypeDefinition |
typeInOtherSchema(org.eclipse.emf.ecore.EClassifier classifier)
|
Methods inherited from class org.eclipse.xsd.presentation.XSDEditor.MapBuilder |
addInput, addOutput, map |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String EMF_SCHEMA_URI
protected static final java.lang.String EMF_SCHEMA_PREFIX
protected static final java.lang.String EMF_SCHEMA_NAME
protected static final java.lang.String REFERENCE_TYPE_NAME
protected XSDSchema xsdSchema
protected XSDSchema emfSchema
protected org.eclipse.emf.ecore.EPackage ePackage
protected java.util.Map ecoreToSchemaName
protected java.util.Map ePackageToXSDSchemaMap
protected org.eclipse.emf.ecore.xmi.XMLResource.XMLMap xmlMap
Constructor Detail |
public XSDEditor.EcoreXMLSchemaBuilder()
Method Detail |
public java.util.Collection generate(org.eclipse.emf.ecore.EPackage ePackage)
public java.util.Collection generate(org.eclipse.emf.ecore.EPackage ePackage, org.eclipse.emf.ecore.xmi.XMLResource.XMLMap map)
protected void createSchema()
protected void createEMFSchema()
protected void addEMFSchema()
protected XSDTypeDefinition typeInOtherSchema(org.eclipse.emf.ecore.EClassifier classifier)
protected void addImport(java.lang.String namespace, java.lang.String schemaLocation)
protected void createOtherSchema(org.eclipse.emf.ecore.EPackage ePackage)
protected void processClasses()
protected void processEnums()
protected org.eclipse.emf.ecore.xmi.XMLResource.XMLInfo getInfo(org.eclipse.emf.ecore.ENamedElement element)
protected java.lang.String getName(org.eclipse.emf.ecore.ENamedElement element)
protected void processEnum(org.eclipse.emf.ecore.EEnum enum)
protected void processClass(org.eclipse.emf.ecore.EClass eClass)
protected boolean makeClassElementDeclaration(org.eclipse.emf.ecore.EClass eClass)
protected void additionalProcessing(org.eclipse.emf.ecore.EClass cls, XSDComplexTypeDefinition xsdComplexTypeDefinition)
protected java.util.List getFeatures(org.eclipse.emf.ecore.EClass eClass, java.util.List superClasses)
protected java.util.List getAllFeatures(org.eclipse.emf.ecore.EClass eClass, java.util.Set classesToIgnore)
protected void processAttribute(org.eclipse.emf.ecore.EAttribute attribute, XSDComplexTypeDefinition xsdComplexTypeDefinition)
The types are mapped as follows: Ecore type Schema type ------------ ------------- EBoolean boolean EBooleanObject boolean EInt int EIntegerObject int ELong long ELongObject long EFloat float EFloatObject float EDouble double EDoubleObject double EString string
If the attribute has no type or if the type is an EDataType that is not an EEnum, the schema string type is used.
If the EAttribute is required, the attribute declaration includes use="required".
If the EAttribute has a defaultValueLiteral, the attribute declaration has a default attribute whose value is the defaultValueLiteral.
If the EAttribute is transient, or its type is not serializable, an attribute declaration is not generated.
If the EAttribute can have many values, an element declaration is created rather than an attribute declaration. The lower bound of the attribute is set to the minOccurs value of the element declaration. The upper bound of the attribute is set to the maxOccurs value of the element declaration (converting -1 to unbounded as appropriate). The type of the element is set as above for attribute declarations.
protected void createAttributeDeclaration(org.eclipse.emf.ecore.EAttribute attribute, XSDComplexTypeDefinition xsdComplexTypeDefinition)
protected void createAttributeElementDeclaration(org.eclipse.emf.ecore.EAttribute attribute, XSDComplexTypeDefinition xsdComplexTypeDefinition)
protected void setAttributeElementMultiplicity(org.eclipse.emf.ecore.EAttribute attribute, XSDParticle particle)
protected boolean processAttribute(org.eclipse.emf.ecore.EAttribute attribute)
protected boolean makeAttributeDeclaration(org.eclipse.emf.ecore.EAttribute attribute)
protected boolean makeAttributeElementDeclaration()
protected XSDModelGroup getModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition)
protected XSDModelGroup createModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition)
protected void setAttributeType(org.eclipse.emf.ecore.EAttribute attribute, XSDAttributeDeclaration attrDecl)
protected void setUseToRequired(org.eclipse.emf.ecore.EAttribute attribute, XSDAttributeUse attrUse)
protected void setDefaultValue(org.eclipse.emf.ecore.EAttribute attribute, XSDAttributeDeclaration attrDecl)
protected void processReference(org.eclipse.emf.ecore.EReference reference, XSDComplexTypeDefinition xsdComplexTypeDefinition)
protected boolean makeReferenceAttribute(org.eclipse.emf.ecore.EReference reference)
protected boolean makeReferenceElement(org.eclipse.emf.ecore.EReference reference)
protected boolean skipReference(org.eclipse.emf.ecore.EReference reference)
protected void makeReferenceAttribute(org.eclipse.emf.ecore.EReference reference, XSDComplexTypeDefinition xsdComplexTypeDefinition)
protected void setReferenceAttribType(XSDAttributeDeclaration xsdAttributeDeclaration)
protected void makeReferenceElement(org.eclipse.emf.ecore.EReference reference, XSDComplexTypeDefinition xsdComplexTypeDefinition)
protected void setReferenceElementType(org.eclipse.emf.ecore.EReference reference, XSDElementDeclaration xsdElementDeclaration)
protected void setReferenceElementMultiplicity(org.eclipse.emf.ecore.EReference reference, XSDParticle particle)
protected XSDSimpleTypeDefinition getType(org.eclipse.emf.ecore.EDataType dataType)
|
Copyright 2001-2002 IBM Corporation and others. All Rights Reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |