protected XSDAttributeDeclaration buildGlobalAttribute(XSDSchema xsdSchema, EStructuralFeature eStructuralFeature) { XSDAttributeDeclaration xsdAttributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration(); xsdAttributeDeclaration.setName(extendedMetaData.getName(eStructuralFeature)); XSDSimpleTypeDefinition xsdSimpleTypeDefinition = xsdSchema.resolveSimpleTypeDefinitionURI(getURI(eStructuralFeature.getEType())); handleImport(xsdSchema, xsdSimpleTypeDefinition); xsdAttributeDeclaration.setTypeDefinition(xsdSimpleTypeDefinition); String defaultValue = eStructuralFeature.getDefaultValueLiteral(); if (defaultValue != null) { xsdAttributeDeclaration.setConstraint(XSDConstraint.DEFAULT_LITERAL); xsdAttributeDeclaration.setLexicalValue(defaultValue); } xsdSchema.getContents().add(xsdAttributeDeclaration); map(xsdAttributeDeclaration, eStructuralFeature); if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE)) { createEcoreAnnotation(xsdAttributeDeclaration, "type", getGenericType(xsdSchema, eStructuralFeature.getEGenericType())); } buildAnnotations(xsdAttributeDeclaration, eStructuralFeature); return xsdAttributeDeclaration; }
protected XSDElementDeclaration buildGlobalElement(XSDSchema xsdSchema, EStructuralFeature eStructuralFeature) { XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration(); xsdElementDeclaration.setName(extendedMetaData.getName(eStructuralFeature)); EClassifier eType = eStructuralFeature.getEType(); XSDTypeDefinition xsdTypeDefinition = xsdSchema.resolveTypeDefinitionURI(getURI(eType)); handleImport(xsdSchema, xsdTypeDefinition); xsdElementDeclaration.setTypeDefinition(xsdTypeDefinition); if (isWrapperType(eType)) { xsdElementDeclaration.setNillable(true); } String defaultValue = eStructuralFeature.getDefaultValueLiteral(); if (defaultValue != null) { xsdElementDeclaration.setConstraint(XSDConstraint.DEFAULT_LITERAL); xsdElementDeclaration.setLexicalValue(defaultValue); } xsdSchema.getContents().add(xsdElementDeclaration); map(xsdElementDeclaration, eStructuralFeature); if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE)) { createEcoreAnnotation(xsdElementDeclaration, "type", getGenericType(xsdSchema, eStructuralFeature.getEGenericType())); } buildAnnotations(xsdElementDeclaration, eStructuralFeature); return xsdElementDeclaration; }
protected XSDAttributeDeclaration buildGlobalAttribute(XSDSchema xsdSchema, EStructuralFeature eStructuralFeature) { XSDAttributeDeclaration xsdAttributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration(); xsdAttributeDeclaration.setName(extendedMetaData.getName(eStructuralFeature)); XSDSimpleTypeDefinition xsdSimpleTypeDefinition = xsdSchema.resolveSimpleTypeDefinitionURI(getURI(eStructuralFeature.getEType())); handleImport(xsdSchema, xsdSimpleTypeDefinition); xsdAttributeDeclaration.setTypeDefinition(xsdSimpleTypeDefinition); String defaultValue = eStructuralFeature.getDefaultValueLiteral(); if (defaultValue != null) { xsdAttributeDeclaration.setConstraint(XSDConstraint.DEFAULT_LITERAL); xsdAttributeDeclaration.setLexicalValue(transformDefaultValue(xsdAttributeDeclaration.getTypeDefinition(), defaultValue)); } xsdSchema.getContents().add(xsdAttributeDeclaration); map(xsdAttributeDeclaration, eStructuralFeature); if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE)) { createEcoreAnnotation(xsdAttributeDeclaration, "type", getGenericType(xsdSchema, eStructuralFeature.getEGenericType())); } buildAnnotations(xsdAttributeDeclaration, eStructuralFeature); return xsdAttributeDeclaration; }
if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE))
if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE))
if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE))
if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE))
map(xsdElementDeclaration, eStructuralFeature); if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE))
if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE))
if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE))