use of org.apache.ws.commons.schema.XmlSchemaFacet in project cxf by apache.
the class EnumType method writeSchema.
@Override
public void writeSchema(XmlSchema root) {
XmlSchemaSimpleType simple = new XmlSchemaSimpleType(root, true);
simple.setName(getSchemaType().getLocalPart());
XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
restriction.setBaseTypeName(Constants.XSD_STRING);
simple.setContent(restriction);
Object[] constants = getTypeClass().getEnumConstants();
List<XmlSchemaFacet> facets = restriction.getFacets();
for (Object constant : constants) {
XmlSchemaEnumerationFacet f = new XmlSchemaEnumerationFacet();
f.setValue(getValue(constant));
facets.add(f);
}
}
Aggregations