protected XSDAttributeUse createAttributeUse(XSDSchema schema, String name, String type, String use, String form, String fixed) { XSDAttributeDeclaration attributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration(); attributeDeclaration.setName(name); attributeDeclaration.setTypeDefinition(schema.getSchemaForSchema().resolveSimpleTypeDefinition(type)); if ("qualified".equals(form)) { attributeDeclaration.setForm(XSDForm.QUALIFIED_LITERAL); } XSDAttributeUse attributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse(); attributeUse.setContent(attributeDeclaration); if ("optional".equals(use)) { attributeUse.setUse(XSDAttributeUseCategory.OPTIONAL_LITERAL); } if ("required".equals(use)) { attributeUse.setUse(XSDAttributeUseCategory.REQUIRED_LITERAL); } if (fixed != null) { attributeUse.setConstraint(XSDConstraint.FIXED_LITERAL); attributeUse.setLexicalValue("2.0"); } return attributeUse; }
protected XSDAttributeUse createAttributeUse(XSDSchema schema, String name, String type, String use, String form, String fixed) { XSDAttributeDeclaration attributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration(); attributeDeclaration.setName(name); attributeDeclaration.setTypeDefinition(schema.getSchemaForSchema().resolveSimpleTypeDefinition(type)); if ("qualified".equals(form)) { attributeDeclaration.setForm(XSDForm.QUALIFIED_LITERAL); } XSDAttributeUse attributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse(); attributeUse.setContent(attributeDeclaration); if ("optional".equals(use)) { attributeUse.setUse(XSDAttributeUseCategory.OPTIONAL_LITERAL); } if ("required".equals(use)) { attributeUse.setUse(XSDAttributeUseCategory.REQUIRED_LITERAL); } if (fixed != null) { attributeUse.setConstraint(XSDConstraint.FIXED_LITERAL); attributeUse.setLexicalValue("2.0"); } return attributeUse; }
simpleAttributeUseGroupMember./*{@link XSDAttributeUse#setContent */setContent/*}*/(simpleAttributeDeclarationGroupMember); simpleAttributeUseGroupMember./*{@link XSDAttributeDeclaration#setConstraint */setConstraint/*}*/(/*{@link */XSDConstraint/*}*/.DEFAULT_LITERAL); simpleAttributeUseGroupMember./*{@link XSDAttributeDeclaration#setLexicalValue */setLexicalValue/*}*/("defaultValue"); simpleAttributeGroupDefinition./*{@link XSDAttributeGroupDefinition#getContents */getContents/*}*/().add(simpleAttributeUseGroupMember);
simpleAttributeUseGroupMember./*{@link XSDAttributeUse#setContent */setContent/*}*/(simpleAttributeDeclarationGroupMember); simpleAttributeUseGroupMember./*{@link XSDAttributeDeclaration#setConstraint */setConstraint/*}*/(/*{@link */XSDConstraint/*}*/.DEFAULT_LITERAL); simpleAttributeUseGroupMember./*{@link XSDAttributeDeclaration#setLexicalValue */setLexicalValue/*}*/("defaultValue"); simpleAttributeGroupDefinition./*{@link XSDAttributeGroupDefinition#getContents */getContents/*}*/().add(simpleAttributeUseGroupMember);
xsdAttriuteUse.setLexicalValue(transformDefaultValue(xsdAttriuteUse.getAttributeDeclaration().getTypeDefinition(), defaultValue));
xsdAttriuteUse.setLexicalValue(defaultValue);
countryAttributeUse.setContent(country); countryAttributeUse./*{@link XSDAttributeDeclaration#setConstraint(XSDConstraint) */setConstraint/*}*/(/*{@link */XSDConstraint/*}*/.FIXED_LITERAL); countryAttributeUse./*{@link XSDAttributeDeclaration#setLexicalValue */setLexicalValue/*}*/("US"); usAddress.getAttributeContents().add(countryAttributeUse);
countryAttributeUse.setContent(country); countryAttributeUse./*{@link XSDAttributeDeclaration#setConstraint(XSDConstraint) */setConstraint/*}*/(/*{@link */XSDConstraint/*}*/.FIXED_LITERAL); countryAttributeUse./*{@link XSDAttributeDeclaration#setLexicalValue */setLexicalValue/*}*/("US"); usAddress.getAttributeContents().add(countryAttributeUse);