if (ce.getContainer() instanceof XSDParticle) { XSDParticle part = (XSDParticle) ce.getContainer(); at.setMinOccurs(part.getMinOccurs()); at.setMaxOccurs(part.getMaxOccurs());
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); } } } };
if (particle.getMinOccurs() == 0) {
int min = particle.getMinOccurs(); int max = particle.getMaxOccurs();
int minOccurs = particle.getMinOccurs(); int maxOccurs = particle.getMaxOccurs(); if (maxOccurs == -1) {
XSDFactory.eINSTANCE.createXSDParticle(); substitutedChildParticle.setMaxOccurs(childParticle.getMaxOccurs()); substitutedChildParticle.setMinOccurs(childParticle.getMinOccurs()); XSDElementDeclaration wrapper = XSDFactory.eINSTANCE.createXSDElementDeclaration();
throw new RuntimeException(); int minOccurs = particle.getMinOccurs(); int maxOccurs = particle.getMaxOccurs(); if (maxOccurs == -1) {
public void visit(XSDParticle particle) { XSDElementDeclaration decl = (XSDElementDeclaration) particle.getContent(); if (decl.isElementDeclarationReference()) { decl = decl.getResolvedElementDeclaration(); } if (decl == fElement) { minOccurs.add(new Integer(particle.getMinOccurs())); } } };
public void visit(XSDParticle particle) { XSDElementDeclaration decl = (XSDElementDeclaration) particle.getContent(); if (decl.isElementDeclarationReference()) { decl = decl.getResolvedElementDeclaration(); } if (decl == fElement) { minOccurs.add(new Integer(particle.getMinOccurs())); } } };
public static int getMinOccurs(XSDConcreteComponent component) { int minOccur = -2; if (component != null) { Object o = component.getContainer(); if (o instanceof XSDParticle) { if (((XSDParticle) o).isSetMinOccurs()) { try { minOccur = ((XSDParticle) o).getMinOccurs(); } catch (Exception e) { } } } } return minOccur; }
int min = ((XSDParticle) xsdWildcard.getContainer()).getMinOccurs(); if (min == XSDParticle.UNBOUNDED) int min = ((XSDParticle) xsdWildcard.getContainer()).getMinOccurs(); result.append(String.valueOf(min));
if (hasMinOccurs) int min = ((XSDParticle) xsdModelGroup.getContainer()).getMinOccurs(); if (min == XSDParticle.UNBOUNDED) int min = ((XSDParticle) xsdModelGroup.getContainer()).getMinOccurs(); result.append(String.valueOf(min));
@Override public String getText(Object object) { XSDParticle xsdParticle = ((XSDParticle)object); XSDParticleContent xsdParticleContent = getDelegate(xsdParticle); if (xsdParticleContent != null) { return itemDelegator.getText(xsdParticleContent); } else { return xsdParticle.getMinOccurs() + ".." + (xsdParticle.getMaxOccurs() == -1 ? "unbounded" : Integer.toString(xsdParticle.getMaxOccurs())); } }
return xsdModelGroup.getParticles().isEmpty() && xsdParticle.getMinOccurs() == 0;
return xsdModelGroup.getParticles().isEmpty() && xsdParticle.getMinOccurs() == 0;
public void execute() { Element element = component.getElement(); try { beginRecording(element); String currentMin = element.getAttribute(XSDConstants.MINOCCURS_ATTRIBUTE); removeMinOccursAttribute = (currentMin == null) ? true : false; if (component instanceof XSDParticle) { oldMinOccurs = ((XSDParticle) component).getMinOccurs(); ((XSDParticle) component).setMinOccurs(newMinOccurs); } else if (component instanceof XSDAttributeUse) { oldMinOccurs = (((XSDAttributeUse) component).getUse() == XSDAttributeUseCategory.REQUIRED_LITERAL ? 1 : 0); if (newMinOccurs == 1) ((XSDAttributeUse) component).setUse(XSDAttributeUseCategory.REQUIRED_LITERAL); else ((XSDAttributeUse) component).setUse(XSDAttributeUseCategory.OPTIONAL_LITERAL); } } finally { endRecording(); } }
return getComponentLabel(xsdParticle.getTerm()) + "[" + xsdParticle.getMinOccurs() + "," + xsdParticle.getMaxOccurs() + "]";
int min = particle.getMinOccurs(); int max = particle.getMaxOccurs();
return getComponentLabel(xsdParticle.getTerm()) + "[" + xsdParticle.getMinOccurs() + "," + xsdParticle.getMaxOccurs() + "]";
particle.setMinOccurs(parentParticle.getMinOccurs()); parentParticle.unsetMinOccurs();