use of org.apache.ws.commons.schema.XmlSchemaSimpleTypeUnion in project hale by halestudio.
the class XmlTypeUtil method configureSimpleType.
/**
* Configure a type definition for a simple type based on the
* {@link XmlSchemaSimpleType}.
*
* @param type the type definition
* @param simpleType the schema simple type
* @param index the XML index for resolving type definitions
* @param reporter the report
*/
public static void configureSimpleType(XmlTypeDefinition type, XmlSchemaSimpleType simpleType, XmlIndex index, IOReporter reporter) {
XmlSchemaSimpleTypeContent content = simpleType.getContent();
// it's a simple type
type.setConstraint(HasValueFlag.ENABLED);
if (content instanceof XmlSchemaSimpleTypeUnion) {
// simple type union
configureSimpleTypeUnion(type, (XmlSchemaSimpleTypeUnion) content, index, reporter);
} else if (content instanceof XmlSchemaSimpleTypeList) {
// simple type list
configureSimpleTypeList(type, (XmlSchemaSimpleTypeList) content, index, reporter);
} else if (content instanceof XmlSchemaSimpleTypeRestriction) {
// simple type restriction
configureSimpleTypeRestriction(type, (XmlSchemaSimpleTypeRestriction) content, index, reporter);
} else {
reporter.error(new IOMessageImpl(MessageFormat.format("Unrecognized simple type {0}", type.getName()), null, simpleType.getLineNumber(), simpleType.getLinePosition()));
}
}
Aggregations