/** * 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; }
child = child.getResolvedElementDeclaration(); child = child.getResolvedElementDeclaration();
/** * 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()); }
XSDParticle part = (XSDParticle) prop[0]; XSDElementDeclaration partContent = (XSDElementDeclaration) part.getContent(); if (partContent.getResolvedElementDeclaration() != null) { partContent = partContent.getResolvedElementDeclaration(); 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); } } } };
@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()); } })
child = child.getResolvedElementDeclaration(); XSDElementDeclaration el = (XSDElementDeclaration) particle.getContent(); if (el.isElementDeclarationReference()) { el = el.getResolvedElementDeclaration(); XSDParticle particle = (XSDParticle) children.get(i); XSDElementDeclaration child = (XSDElementDeclaration) particle.getContent(); if (child.getResolvedElementDeclaration() != null) { child = child.getResolvedElementDeclaration(); XSDParticle part = (XSDParticle) prop[0]; XSDElementDeclaration partContent = (XSDElementDeclaration) part.getContent(); if (partContent.getResolvedElementDeclaration() != null) { partContent = partContent.getResolvedElementDeclaration();
attribute = attribute.getResolvedElementDeclaration();
XSDElementDeclaration content = (XSDElementDeclaration) particle.getContent(); if (content.isElementDeclarationReference()) { content = content.getResolvedElementDeclaration();
child = child.getResolvedElementDeclaration();
property = property.getResolvedElementDeclaration();
elemDecl = elemDecl.getResolvedElementDeclaration();
XSDElementDeclaration childElement = (XSDElementDeclaration) childParticle.getContent(); if (childElement.isElementDeclarationReference()) { childElement = childElement.getResolvedElementDeclaration(); if (childElement .getType()
XSDElementDeclaration element = (XSDElementDeclaration) particle.getContent(); if (element.isElementDeclarationReference()) { element = element.getResolvedElementDeclaration();
element = element.getResolvedElementDeclaration();
attribute = attribute.getResolvedElementDeclaration(); (XSDElementDeclaration) particle2.getContent(); if (attribute2.isElementDeclarationReference()) { attribute2 = attribute2.getResolvedElementDeclaration();
elemDecl = elemDecl.getResolvedElementDeclaration(); elemDecl = elemDecl.getResolvedElementDeclaration();
.getContent(); if (element.isElementDeclarationReference()) { element = element.getResolvedElementDeclaration();