/** * Returns a list of all child element declarations of the specified type, no order is * guaranteed. * * <p>The <code>includeParents</code> flag controls if this method should returns those elements * defined on parent types. * * @param type The type * @param includeParents flag indicating if parent types should be processed * @return A list of @link XSDElementDeclaration objects, one for each child element. */ public static final List getChildElementDeclarations( XSDTypeDefinition type, boolean includeParents) { List particles = getChildElementParticles(type, includeParents); List elements = new ArrayList(); for (Iterator p = particles.iterator(); p.hasNext(); ) { XSDParticle particle = (XSDParticle) p.next(); XSDElementDeclaration decl = (XSDElementDeclaration) particle.getContent(); if (decl.isElementDeclarationReference()) { decl = decl.getResolvedElementDeclaration(); } elements.add(decl); } return elements; }
XSDElementDeclaration child = (XSDElementDeclaration) particle.getContent(); particle = (XSDParticle) matches.get(0); XSDElementDeclaration child = (XSDElementDeclaration) particle.getContent();
/** * Returns the particle for an element declaration that is part of a type. * * @param type The type definition. * @param name The naem of the child element declaration. * @param includeParents Flag to control wether parent types are included. * @return The particle representing the element declaration, or <code>null</code> if it could * not be found. */ public static final XSDParticle getChildElementParticle( XSDTypeDefinition type, String name, boolean includeParents) { List particles = getChildElementParticles(type, includeParents); for (Iterator p = particles.iterator(); p.hasNext(); ) { XSDParticle particle = (XSDParticle) p.next(); XSDElementDeclaration element = (XSDElementDeclaration) particle.getContent(); if (element.isElementDeclarationReference()) { element.getResolvedElementDeclaration(); } if (name.equals(element.getName())) { return particle; } } return null; }
/** Returns the name of the element represented by the particle as a QName. */ public static QName getParticleName(XSDParticle particle) { XSDElementDeclaration content = (XSDElementDeclaration) particle.getContent(); if (content.isElementDeclarationReference()) { content = content.getResolvedElementDeclaration(); } return new QName(content.getTargetNamespace(), content.getName()); }
Object[] prop = (Object[]) itr.next(); XSDParticle part = (XSDParticle) prop[0]; XSDElementDeclaration partContent = (XSDElementDeclaration) part.getContent(); if (partContent.getResolvedElementDeclaration() != null) { partContent = partContent.getResolvedElementDeclaration(); for (int i = 0; i < children.size(); i++) { XSDParticle particle = (XSDParticle) children.get(i); XSDElementDeclaration child = (XSDElementDeclaration) particle.getContent(); if (child.getResolvedElementDeclaration() != null) { child = child.getResolvedElementDeclaration();
public void visit(XSDParticle particle) { XSDElementDeclaration decl = (XSDElementDeclaration) particle.getContent(); if (decl.isElementDeclarationReference()) { decl = decl.getResolvedElementDeclaration(); } if (decl == fElement) { if (particle.isSetMaxOccurs()) { maxOccurs.add(Integer.valueOf(particle.getMaxOccurs())); } else if (particle.getContainer() instanceof XSDModelGroup && particle.getContainer().getContainer() instanceof XSDParticle) { particle = (XSDParticle) particle.getContainer().getContainer(); maxOccurs.add(Integer.valueOf(particle.getMaxOccurs())); } else { maxOccurs.add(1); } } } };
public void visit(XSDParticle particle) { XSDElementDeclaration decl = (XSDElementDeclaration) particle.getContent(); if (decl.isElementDeclarationReference()) { decl = decl.getResolvedElementDeclaration(); } if (decl == fElement) { if (particle.isSetMinOccurs()) { minOccurs.add(Integer.valueOf(particle.getMinOccurs())); } else if (particle.getContainer() instanceof XSDModelGroup && particle.getContainer().getContainer() instanceof XSDParticle) { particle = (XSDParticle) particle.getContainer().getContainer(); minOccurs.add(Integer.valueOf(particle.getMinOccurs())); } else { minOccurs.add(1); } } } };
case XSDConstants.GROUP_ELEMENT: XSDModelGroupDefinition grpDef = (XSDModelGroupDefinition) particle.getContent(); case XSDConstants.ALL_ELEMENT: case XSDConstants.SEQUENCE_ELEMENT: grp = (XSDModelGroup) particle.getContent();
case XSDConstants.GROUP_ELEMENT: XSDModelGroupDefinition grpDef = (XSDModelGroupDefinition) particle.getContent(); case XSDConstants.ALL_ELEMENT: case XSDConstants.SEQUENCE_ELEMENT: grp = (XSDModelGroup) particle.getContent();
@Override public Object apply(Object particle) { XSDElementDeclaration attr = (XSDElementDeclaration) ((XSDParticle) particle) .getContent(); if (attr .isElementDeclarationReference()) { attr = attr .getResolvedElementDeclaration(); } return new NameImpl( attr.getTargetNamespace(), attr.getName()); } })
for ( Iterator p = particles.iterator(); p.hasNext(); ) { XSDParticle particle = (XSDParticle) p.next(); XSDElementDeclaration element = (XSDElementDeclaration) particle.getContent();
XSDElementDeclaration attribute = (XSDElementDeclaration) particle.getContent();
for (Iterator itr = children.iterator(); itr.hasNext(); ) { XSDParticle particle = (XSDParticle) itr.next(); XSDElementDeclaration child = (XSDElementDeclaration) particle.getContent(); p.hasNext(); ) { XSDParticle particle = (XSDParticle) p.next(); XSDElementDeclaration el = (XSDElementDeclaration) particle.getContent(); if (el.isElementDeclarationReference()) { el = el.getResolvedElementDeclaration(); XSDElementDeclaration child = (XSDElementDeclaration) particle.getContent(); if (child.getResolvedElementDeclaration() != null) { child = child.getResolvedElementDeclaration(); Object[] prop = (Object[]) itr.next(); XSDParticle part = (XSDParticle) prop[0]; XSDElementDeclaration partContent = (XSDElementDeclaration) part.getContent(); if (partContent.getResolvedElementDeclaration() != null) { partContent = partContent.getResolvedElementDeclaration();
i.hasNext(); ) { XSDParticle particle = (XSDParticle) i.next(); XSDElementDeclaration child = (XSDElementDeclaration) particle.getContent();
Object[] o = (Object[]) p.next(); XSDParticle particle = (XSDParticle) o[0]; XSDElementDeclaration content = (XSDElementDeclaration) particle.getContent(); if (content.isElementDeclarationReference()) { content = content.getResolvedElementDeclaration();
(List<XSDParticle>) Schemas.getChildElementParticles(element.getTypeDefinition(), true)) { XSDElementDeclaration childElement = (XSDElementDeclaration) childParticle.getContent(); if (childElement.isElementDeclarationReference()) { childElement = childElement.getResolvedElementDeclaration();
XSDElementDeclaration property = (XSDElementDeclaration) particle.getContent();
for (Iterator itr = children.iterator(); itr.hasNext();) { XSDParticle particle = (XSDParticle) itr.next(); XSDElementDeclaration element = (XSDElementDeclaration) particle.getContent(); if (element.isElementDeclarationReference()) { element = element.getResolvedElementDeclaration();
(XSDElementDeclaration) particle.getContent();
.getChildElementParticles(xsdType, false)) { XSDElementDeclaration element = (XSDElementDeclaration) particle .getContent(); if (element.isElementDeclarationReference()) { element = element.getResolvedElementDeclaration();