protected void setDefaultValue(EAttribute attribute, XSDAttributeDeclaration attrDecl) { if (attribute.getDefaultValueLiteral() != null) { attrDecl.setConstraint(XSDConstraint.DEFAULT_LITERAL); attrDecl.setLexicalValue(attribute.getDefaultValueLiteral()); } }
protected void setDefaultValue(EAttribute attribute, XSDAttributeDeclaration attrDecl) { if (attribute.getDefaultValueLiteral() != null) { attrDecl.setConstraint(XSDConstraint.DEFAULT_LITERAL); attrDecl.setLexicalValue(attribute.getDefaultValueLiteral()); } }
(prototypeSchema.resolveSimpleTypeDefinition(/*{@link #*/someOtherSchemaURI/*}*/, "someOtherTypeDefinition")); simpleAttributeDeclaration./*{@link XSDAttributeDeclaration#setConstraint */setConstraint/*}*/(/*{@link */XSDConstraint/*}*/.DEFAULT_LITERAL); simpleAttributeDeclaration./*{@link XSDAttributeDeclaration#setLexicalValue */setLexicalValue/*}*/("defaultValue");
(prototypeSchema.resolveSimpleTypeDefinition(/*{@link #*/someOtherSchemaURI/*}*/, "someOtherTypeDefinition")); simpleAttributeDeclaration./*{@link XSDAttributeDeclaration#setConstraint */setConstraint/*}*/(/*{@link */XSDConstraint/*}*/.DEFAULT_LITERAL); simpleAttributeDeclaration./*{@link XSDAttributeDeclaration#setLexicalValue */setLexicalValue/*}*/("defaultValue");
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 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; }
xsdAttributeDeclaration.setLexicalValue(transformDefaultValue(xsdAttributeDeclaration.getTypeDefinition(), defaultValue));
xsdAttributeDeclaration.setLexicalValue(defaultValue);