XmlSchemaObjectTable schemaTypes = schema.getSchema().getSchemaTypes();
Iterator namesIterator = schemaTypes.getNames();
while (namesIterator.hasNext()) {
QName name = (QName)namesIterator.next();
XmlSchemaObject xmlSchemaObject = (XmlSchemaObject)schemaTypes.getItem(name);
if (xmlSchemaObject instanceof XmlSchemaComplexType) {
try {
XmlSchemaComplexType complexType = (XmlSchemaComplexType)xmlSchemaObject;
if (!JavascriptUtils.notVeryComplexType(complexType)
&& complexType.getName() != null) {
complexTypeConstructorAndAccessors(complexType.getQName(), complexType);
complexTypeSerializerFunction(complexType.getQName(), complexType);
domDeserializerFunction(complexType.getQName(), complexType);
}
} catch (UnsupportedConstruct usc) {
LOG.warning(usc.toString());
continue; // it could be empty, but the style checker
// would complain.
}
} else if (xmlSchemaObject instanceof XmlSchemaSimpleType) {
XmlSchemaSimpleType simpleType = (XmlSchemaSimpleType)xmlSchemaObject;
if (XmlSchemaUtils.isEumeration(simpleType)) {
List<String> values = XmlSchemaUtils.enumeratorValues(simpleType);
code.append("//\n");
code.append("// Simple type (enumeration) " + simpleType.getQName() + "\n");
code.append("//\n");
for (String value : values) {
code.append("// - " + value + "\n");
}
}
}
}
// now add in global elements with anonymous types.
schemaTypes = schema.getSchema().getElements();
namesIterator = schemaTypes.getNames();
while (namesIterator.hasNext()) {
QName name = (QName)namesIterator.next();
XmlSchemaObject xmlSchemaObject = (XmlSchemaObject)schemaTypes.getItem(name);
if (xmlSchemaObject instanceof XmlSchemaElement) { // the
// alternative
// is too wierd
// to
// contemplate.