public void execute() { try { beginRecording(xsdSimpleTypeDefinition.getElement()); if (actionType == ADD) { XSDPatternFacet pattern = XSDFactory.eINSTANCE.createXSDPatternFacet(); pattern.setLexicalValue(value); xsdSimpleTypeDefinition.getFacetContents().add(pattern); } else if (actionType == DELETE) { Assert.isNotNull(patternToEdit); if (xsdSimpleTypeDefinition.getFacetContents().contains(patternToEdit)) xsdSimpleTypeDefinition.getFacetContents().remove(patternToEdit); } else if (actionType == UPDATE) { Assert.isNotNull(patternToEdit); patternToEdit.setLexicalValue(value); } formatChild(xsdSimpleTypeDefinition.getElement()); } finally { endRecording(); } } }
xsdSimpleType.getFacetContents().add(minInclusiveFacet); xsdSimpleType.getFacetContents().remove(minExclusiveFacet); xsdSimpleType.getFacetContents().remove(minInclusiveFacet); xsdSimpleType.getFacetContents().add(minExclusiveFacet); xsdSimpleType.getFacetContents().remove(minInclusiveFacet); xsdSimpleType.getFacetContents().remove(minExclusiveFacet); xsdSimpleType.getFacetContents().add(maxInclusiveFacet); xsdSimpleType.getFacetContents().remove(maxExclusiveFacet); xsdSimpleType.getFacetContents().remove(maxInclusiveFacet); xsdSimpleType.getFacetContents().add(maxExclusiveFacet); xsdSimpleType.getFacetContents().remove(maxInclusiveFacet); xsdSimpleType.getFacetContents().remove(maxExclusiveFacet);
xsdSimpleType.getFacetContents().add(lengthFacet); xsdSimpleType.getFacetContents().remove(maxLengthFacet); xsdSimpleType.getFacetContents().remove(minLengthFacet); xsdSimpleType.getFacetContents().remove(lengthFacet); xsdSimpleType.getFacetContents().add(minLengthFacet); xsdSimpleType.getFacetContents().remove(maxLengthFacet); xsdSimpleType.getFacetContents().add(lengthFacet); xsdSimpleType.getFacetContents().remove(minLengthFacet); xsdSimpleType.getFacetContents().remove(lengthFacet); xsdSimpleType.getFacetContents().add(maxLengthFacet); xsdSimpleType.getFacetContents().add(minLengthFacet); xsdSimpleType.getFacetContents().remove(lengthFacet); xsdSimpleType.getFacetContents().add(minLengthFacet); xsdSimpleType.getFacetContents().add(maxLengthFacet); xsdSimpleType.getFacetContents().add(lengthFacet); xsdSimpleType.getFacetContents().remove(maxLengthFacet); xsdSimpleType.getFacetContents().remove(minLengthFacet);
for (final XSDFacet xsdFacet : xsdSimpleTypeDefinition.getFacetContents())
for (final XSDFacet xsdFacet : xsdSimpleTypeDefinition.getFacetContents())
if (whitespaceFacet != null) if (xsdSimpleTypeDefinition.getFacetContents().contains(whitespaceFacet))
xsdSimpleTypeDefinition.getFacetContents().add(whitespaceFacet); xsdSimpleTypeDefinition.getFacetContents().remove(whitespaceFacet);
public void execute() { try { beginRecording(simpleType.getElement()); XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory(); XSDEnumerationFacet enumerationFacet = factory.createXSDEnumerationFacet(); enumerationFacet.setLexicalValue(value); simpleType.getFacetContents().add(enumerationFacet); formatChild(simpleType.getElement()); } finally { endRecording(); } } }
/** * 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 processEnum(EEnum eEnum) { XSDSimpleTypeDefinition enumType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition(); enumType.setName(getName(eEnum)); enumType.setBaseTypeDefinition(xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("NCName")); xsdSchema.getContents().add(enumType); map(enumType, eEnum); for (EEnumLiteral literal : eEnum.getELiterals()) { XSDEnumerationFacet facet = XSDFactory.eINSTANCE.createXSDEnumerationFacet(); facet.setLexicalValue(getName(literal)); enumType.getFacetContents().add(facet); map(facet, literal); } }
/** * 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 processEnum(EEnum eEnum) { XSDSimpleTypeDefinition enumType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition(); enumType.setName(getName(eEnum)); enumType.setBaseTypeDefinition(xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("NCName")); xsdSchema.getContents().add(enumType); map(enumType, eEnum); for (EEnumLiteral literal : eEnum.getELiterals()) { XSDEnumerationFacet facet = XSDFactory.eINSTANCE.createXSDEnumerationFacet(); facet.setLexicalValue(getName(literal)); enumType.getFacetContents().add(facet); map(facet, literal); } }
xsdRestrictedTypeDefinition.getFacetContents().add(xsdLengthFacet); xsdRestrictedTypeDefinition.getFacetContents().add(xsdMinLengthFacet); xsdRestrictedTypeDefinition.getFacetContents().add(xsdMaxLengthFacet);
simpleTypeDefinition./*{@link XSDSimpleTypeDefinition#getFacetContents */getFacetContents/*}*/().add(xsdMaxInclusiveFacet);
simpleTypeDefinition./*{@link XSDSimpleTypeDefinition#getFacetContents */getFacetContents/*}*/().add(xsdMaxInclusiveFacet);
xsdSimpleTypeDefinition.getFacetContents().add(xsdMinInclusiveFacet); xsdSimpleTypeDefinition.getFacetContents().add(xsdMaxInclusiveFacet); xsdSimpleTypeDefinition.getFacetContents().add(xsdMinExclusiveFacet); xsdSimpleTypeDefinition.getFacetContents().add(xsdMaxExclusiveFacet); XSDEnumerationFacet facet = XSDFactory.eINSTANCE.createXSDEnumerationFacet(); facet.setLexicalValue(literal.getLiteral()); xsdSimpleTypeDefinition.getFacetContents().add(facet); map(facet, literal);
xsdRestrictedTypeDefinition.getFacetContents().add(xsdLengthFacet); xsdRestrictedTypeDefinition.getFacetContents().add(xsdMinLengthFacet); xsdRestrictedTypeDefinition.getFacetContents().add(xsdMaxLengthFacet);
anonymousSimpleTypeDefinition./*{@link XSDSimpleTypeDefinition#getFacetContents */getFacetContents/*}*/().add(xsdPatternFacet);
anonymousSimpleTypeDefinition./*{@link XSDSimpleTypeDefinition#getFacetContents */getFacetContents/*}*/().add(xsdPatternFacet);
for (XSDFacet xsdFacet : xsdSimpleTypeDefinition.getFacetContents())
for (XSDFacet xsdFacet : xsdSimpleTypeDefinition.getFacetContents())
enumerationFacet.getSimpleTypeDefinition().getFacetContents().remove(enumerationFacet);