public Element elementDecl(XSElementDecl decl) { QName n = BGMBuilder.getName(decl); GElementImpl e = decls.get(n); if(e==null) decls.put(n,e=new GElementImpl(n,decl)); e.particles.add(current); assert current.getTerm()==decl; return e; }
public Element elementDecl(XSElementDecl decl) { QName n = BGMBuilder.getName(decl); GElementImpl e = decls.get(n); if(e==null) decls.put(n,e=new GElementImpl(n,decl)); e.particles.add(current); assert current.getTerm()==decl; return e; }
private void visit(XSModelGroup mg, List<XSComponent> r) { // since model groups never form a cycle, no cycle check is needed r.add(mg); for (XSParticle p : mg) { XSModelGroup child = p.getTerm().asModelGroup(); if(child!=null) visit(child,r); } }
private void visit(XSModelGroup mg, List<XSComponent> r) { // since model groups never form a cycle, no cycle check is needed r.add(mg); for (XSParticle p : mg) { XSModelGroup child = p.getTerm().asModelGroup(); if(child!=null) visit(child,r); } }
private void visit(XSModelGroup mg, List<XSComponent> r) { // since model groups never form a cycle, no cycle check is needed r.add(mg); for (XSParticle p : mg) { XSModelGroup child = p.getTerm().asModelGroup(); if(child!=null) visit(child,r); } }
/** * Gets a {@link NameClass} that represents all the terms in the given content type. * If t is not a particle, just return an empty name class. */ private NameClass getNameClass(XSContentType t) { if(t==null) return NameClass.NULL; XSParticle p = t.asParticle(); if(p==null) return NameClass.NULL; else return p.getTerm().apply(contentModelNameClassBuilder); }
/** * Gets a {@link NameClass} that represents all the terms in the given content type. * If t is not a particle, just return an empty name class. */ private NameClass getNameClass(XSContentType t) { if(t==null) return NameClass.NULL; XSParticle p = t.asParticle(); if(p==null) return NameClass.NULL; else return p.getTerm().apply(contentModelNameClassBuilder); }
private List<PropertyUse> findElementDecls(final XSModelGroupDecl modelGroup) { final List<PropertyUse> elementDecls = new ArrayList<>(); for (final XSParticle child : modelGroup.getModelGroup()) { XSTerm term = child.getTerm(); if (term instanceof XSElementDecl) { elementDecls.add(new PropertyUse(term)); } else if (term instanceof XSModelGroupDecl && ((XSModelGroupDecl)term).getName().equals(modelGroup.getName())) { elementDecls.addAll(findElementDecls((XSModelGroupDecl)term)); } } return elementDecls; }
/** * Build up {@link #refs} and compute the total multiplicity of this {@link RawTypeSet.Ref} set. */ private void particle( XSParticle p ) { // if the DOM customization is present, bind it like a wildcard BIDom dom = builder.getLocalDomCustomization(p); if(dom!=null) { dom.markAsAcknowledged(); refs.add(new WildcardRef(WildcardMode.SKIP)); } else { p.getTerm().visit(this); } }
/** * Build up {@link #refs} and compute the total multiplicity of this {@link RawTypeSet.Ref} set. */ private void particle( XSParticle p ) { // if the DOM customization is present, bind it like a wildcard BIDom dom = builder.getLocalDomCustomization(p); if(dom!=null) { dom.markAsAcknowledged(); refs.add(new WildcardRef(WildcardMode.SKIP)); } else { p.getTerm().visit(this); } }
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) ); }
protected final <T extends BIDeclaration> T getLocalCustomization( XSParticle p, Class<T> type ) { // check the property customization of this component first T cust = builder.getBindInfo(p).get(type); if(cust!=null) return cust; // if not, the term might have one. cust = builder.getBindInfo(p.getTerm()).get(type); if(cust!=null) return cust; return null; }
public NameClass modelGroup(XSModelGroup group) { NameClass nc = NameClass.NULL; for( int i=0; i<group.getSize(); i++ ) nc = new ChoiceNameClass(nc, group.getChild(i).getTerm().apply(this)); return nc; }
protected final <T extends BIDeclaration> T getLocalCustomization( XSParticle p, Class<T> type ) { // check the property customization of this component first T cust = builder.getBindInfo(p).get(type); if(cust!=null) return cust; // if not, the term might have one. cust = builder.getBindInfo(p.getTerm()).get(type); if(cust!=null) return cust; return null; }
protected final <T extends BIDeclaration> T getLocalCustomization( XSParticle p, Class<T> type ) { // check the property customization of this component first T cust = builder.getBindInfo(p).get(type); if(cust!=null) return cust; // if not, the term might have one. cust = builder.getBindInfo(p.getTerm()).get(type); if(cust!=null) return cust; return null; }
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 void particle(XSParticle p) { // determine the binding of this complex type. builder.recordBindingMode(ct, bgmBuilder.getParticleBinder().checkFallback(p)?FALLBACK_CONTENT:NORMAL); bgmBuilder.getParticleBinder().build(p); XSTerm term = p.getTerm(); if(term.isModelGroup() && term.asModelGroup().getCompositor()==XSModelGroup.ALL) selector.getCurrentBean().setOrdered(false); }
public void particle(XSParticle p) { // determine the binding of this complex type. builder.recordBindingMode(ct, bgmBuilder.getParticleBinder().checkFallback(p)?FALLBACK_CONTENT:NORMAL); bgmBuilder.getParticleBinder().build(p); XSTerm term = p.getTerm(); if(term.isModelGroup() && term.asModelGroup().getCompositor()==XSModelGroup.ALL) selector.getCurrentBean().setOrdered(false); }