use of org.apache.ws.commons.schema.XmlSchemaParticle in project tomee by apache.
the class CommonsSchemaInfoBuilder method getNestedElements.
private static List<XmlSchemaElement> getNestedElements(XmlSchemaComplexType complexType) {
List<XmlSchemaElement> elements = new ArrayList<>();
XmlSchemaParticle particle = complexType.getParticle();
if (particle instanceof XmlSchemaElement) {
XmlSchemaElement element = (XmlSchemaElement) particle;
elements.add(element);
} else if (particle instanceof XmlSchemaGroupBase && !(particle instanceof XmlSchemaChoice)) {
XmlSchemaGroupBase groupBase = (XmlSchemaGroupBase) particle;
for (Iterator iterator = groupBase.getItems().getIterator(); iterator.hasNext(); ) {
XmlSchemaParticle child = (XmlSchemaParticle) iterator.next();
if (child instanceof XmlSchemaElement) {
XmlSchemaElement element = (XmlSchemaElement) child;
elements.add(element);
}
}
} else {
// ignore all other types... you can have these other types, but JAX-RPC doesn't support them
}
return elements;
}
Aggregations