private XsdNodeCardinality getXmlItemCardinality(XSParticle xsParticle) { if (xsParticle.getMinOccurs().compareTo(BigInteger.valueOf(0)) == 0) { // minOccurs == 0 if (xsParticle.getMaxOccurs().compareTo(BigInteger.valueOf(XSParticle.UNBOUNDED)) != 0) { // maxOccurs != UNBOUNDED return XsdNodeCardinality.ONCE_OPTIONALY; } else { // maxOccurs == UNBOUNDED return XsdNodeCardinality.ZERO_OR_MORE; } } else { return XsdNodeCardinality.ONCE_EXACTLY; } }
public Multiplicity particle( XSParticle p ) { Multiplicity m = p.getTerm().apply(this); BigInteger max; if (m.max==null || (BigInteger.valueOf(XSParticle.UNBOUNDED).equals(p.getMaxOccurs()))) max=null; else max=p.getMaxOccurs(); return Multiplicity.multiply( m, Multiplicity.create(p.getMinOccurs(),max) ); }
public Multiplicity particle( XSParticle p ) { Multiplicity m = p.getTerm().apply(this); BigInteger max; if (m.max==null || (BigInteger.valueOf(XSParticle.UNBOUNDED).equals(p.getMaxOccurs()))) max=null; else max=p.getMaxOccurs(); return Multiplicity.multiply( m, Multiplicity.create(p.getMinOccurs(),max) ); }
public Expression particle(XSParticle p) { current = p; Expression e = p.getTerm().apply(this); if(p.isRepeated()) e = new OneOrMore(e); if (BigInteger.ZERO.equals(p.getMinOccurs())) e = new Choice(e,Expression.EPSILON); return e; }
public Multiplicity particle( XSParticle p ) { Multiplicity m = p.getTerm().apply(this); BigInteger max; if (m.max==null || (BigInteger.valueOf(XSParticle.UNBOUNDED).equals(p.getMaxOccurs()))) max=null; else max=p.getMaxOccurs(); return Multiplicity.multiply( m, Multiplicity.create(p.getMinOccurs(),max) ); }
@Override public Multiplicity particle(XSParticle p) { Multiplicity m = p.getTerm().apply(this.counter); BigInteger max; if (m.max == null || (BigInteger.valueOf(XSParticle.UNBOUNDED).equals(p .getMaxOccurs()))) max = null; else max = p.getMaxOccurs(); return Multiplicity.multiply(m, Multiplicity.create(p.getMinOccurs(), max)); }
public Multiplicity particle(XSParticle p) { Multiplicity m = p.getTerm().apply(this); BigInteger max; if (m == null || m.max == null || (BigInteger.valueOf(XSParticle.UNBOUNDED).equals(p .getMaxOccurs()))) max = null; else max = p.getMaxOccurs(); return Multiplicity.multiply(m, Multiplicity.create(p.getMinOccurs(), max)); }
public Expression particle(XSParticle p) { current = p; Expression e = p.getTerm().apply(this); if(p.isRepeated()) e = new OneOrMore(e); if (BigInteger.ZERO.equals(p.getMinOccurs())) e = new Choice(e,Expression.EPSILON); return e; }
public Multiplicity particle(XSParticle p) { Multiplicity m = p.getTerm().apply(this); BigInteger max; if (m == null || m.max == null || (BigInteger.valueOf(XSParticle.UNBOUNDED).equals(p .getMaxOccurs()))) max = null; else max = p.getMaxOccurs(); return Multiplicity.multiply(m, Multiplicity.create(p.getMinOccurs(), max)); }
public Expression particle(XSParticle p) { current = p; Expression e = p.getTerm().apply(this); if(p.isRepeated()) e = new OneOrMore(e); if (BigInteger.ZERO.equals(p.getMinOccurs())) e = new Choice(e,Expression.EPSILON); return e; }
@Override public Multiplicity particle(XSParticle p) { Multiplicity m = p.getTerm().apply(this.counter); BigInteger max; if (m.max == null || (BigInteger.valueOf(XSParticle.UNBOUNDED).equals(p .getMaxOccurs()))) max = null; else max = p.getMaxOccurs(); return Multiplicity.multiply(m, Multiplicity.create(p.getMinOccurs(), max)); }
public Expression particle(XSParticle p) { current = p; Expression e = p.getTerm().apply(this); if(p.isRepeated()) e = new OneOrMore(e); if(p.getMinOccurs()==0) e = new Choice(e,Expression.EPSILON); return e; }
public Expression particle(XSParticle p) { current = p; Expression e = p.getTerm().apply(this); if(p.isRepeated()) e = new OneOrMore(e); if(p.getMinOccurs()==0) e = new Choice(e,Expression.EPSILON); return e; }
public Multiplicity particle( XSParticle p ) { Multiplicity m = p.getTerm().apply(this); Integer max; if(m.max==null || p.getMaxOccurs()==XSParticle.UNBOUNDED) max=null; else max=p.getMaxOccurs(); return Multiplicity.multiply( m, Multiplicity.create(p.getMinOccurs(),max) ); }
public Multiplicity particle( XSParticle p ) { Multiplicity m = p.getTerm().apply(this); Integer max; if(m.max==null || p.getMaxOccurs()==XSParticle.UNBOUNDED) max=null; else max=p.getMaxOccurs(); return Multiplicity.multiply( m, Multiplicity.create(p.getMinOccurs(),max) ); }
protected void processParticle(XSParticle particle, ParseContext parseContext) throws Exception { parseContext.minOccurs = particle.getMinOccurs().intValue(); parseContext.maxOccurs = particle.getMaxOccurs().intValue(); XSTerm term = particle.getTerm(); if (term.isModelGroup()) { processGroup(term.asModelGroup(), parseContext); } else if (term.isModelGroupDecl()) { processGroupDecl(term.asModelGroupDecl(), parseContext); } else if (term.isElementDecl()) { processElement(term.asElementDecl(), parseContext); } }
public void particle( XSParticle p ) { XSTerm t = p.getTerm(); if(marked(p)) { BIProperty cust = BIProperty.getCustomization(p); CPropertyInfo prop = cust.createElementOrReferenceProperty( getLabel(p), false, p, RawTypeSetBuilder.build(p,insideOptionalParticle)); getCurrentBean().addProperty(prop); } else { // repeated model groups should have been marked already assert !p.isRepeated(); boolean oldIOP = insideOptionalParticle; insideOptionalParticle |= BigInteger.ZERO.equals(p.getMinOccurs()); // this is an unmarked particle t.visit(this); insideOptionalParticle = oldIOP; } }
public void particle( XSParticle p ) { XSTerm t = p.getTerm(); if(marked(p)) { BIProperty cust = BIProperty.getCustomization(p); CPropertyInfo prop = cust.createElementOrReferenceProperty( getLabel(p), false, p, RawTypeSetBuilder.build(p,insideOptionalParticle)); getCurrentBean().addProperty(prop); } else { // repeated model groups should have been marked already assert !p.isRepeated(); boolean oldIOP = insideOptionalParticle; insideOptionalParticle |= BigInteger.ZERO.equals(p.getMinOccurs()); // this is an unmarked particle t.visit(this); insideOptionalParticle = oldIOP; } }
public boolean isOptional(final String elementName) { for (final Entry<String, XSComplexType> entry : getComplexTypes().entrySet()) { final XSContentType content = entry.getValue().getContentType(); final XSParticle particle = content.asParticle(); if (null != particle) { final XSTerm term = particle.getTerm(); if (term.isModelGroup()) { final XSParticle[] particles = term.asModelGroup().getChildren(); for (final XSParticle p : particles) { final XSTerm pterm = p.getTerm(); if (pterm.isElementDecl()) { final XSElementDecl e = pterm.asElementDecl(); if (0 == e.getName().compareToIgnoreCase(elementName)) { return p.getMinOccurs() == 0; } } } } } } return true; }
public void particle( XSParticle p ) { XSTerm t = p.getTerm(); if(marked(p)) { BIProperty cust = BIProperty.getCustomization(p); CPropertyInfo prop = cust.createElementOrReferenceProperty( getLabel(p), false, p, RawTypeSetBuilder.build(p,insideOptionalParticle)); getCurrentBean().addProperty(prop); } else { // repeated model groups should have been marked already assert !p.isRepeated(); boolean oldIOP = insideOptionalParticle; insideOptionalParticle |= p.getMinOccurs()==0; // this is an unmarked particle t.visit(this); insideOptionalParticle = oldIOP; } }