use of org.apache.xerces.xs.XSParticle in project iaf by ibissource.
the class XmlAligner method findMultipleOccurringChildElements.
protected Set<String> findMultipleOccurringChildElements(XSParticle particle) {
Set<String> result = new HashSet<String>();
if (particle == null) {
log.warn("typeDefinition particle is null, is this a problem?");
return result;
}
XSTerm term = particle.getTerm();
if (term == null) {
throw new IllegalStateException("findMultipleOccurringChildElements particle.term is null");
}
if (log.isTraceEnabled())
log.trace("term name [" + term.getName() + "] occurring unbounded [" + particle.getMaxOccursUnbounded() + "] max occur [" + particle.getMaxOccurs() + "] term [" + ToStringBuilder.reflectionToString(term) + "]");
if (particle.getMaxOccursUnbounded() || particle.getMaxOccurs() > 1) {
collectChildElements(particle, result);
return result;
}
if (term instanceof XSModelGroup) {
XSModelGroup modelGroup = (XSModelGroup) term;
XSObjectList particles = modelGroup.getParticles();
if (log.isTraceEnabled())
log.trace("modelGroup particles [" + ToStringBuilder.reflectionToString(particles) + "]");
for (int i = 0; i < particles.getLength(); i++) {
XSParticle childParticle = (XSParticle) particles.item(i);
result.addAll(findMultipleOccurringChildElements(childParticle));
}
}
return result;
}
Aggregations