Refine search
public void modelGroup( XSModelGroup mg ) { boolean oldIOP = insideOptionalParticle; insideOptionalParticle |= mg.getCompositor()==XSModelGroup.CHOICE; for( XSParticle p : mg.getChildren()) particle(p); insideOptionalParticle = oldIOP; } }
public void modelGroup(XSModelGroup mg) { String operator; if(mg.getCompositor()==XSModelGroup.CHOICE) operator = "Or"; else operator = "And"; int size = mg.getSize(); for( int i=0; i<size; i++ ) { XSParticle p = mg.getChild(i); boolean oldRep = rep; rep |= p.isRepeated(); p.getTerm().visit(this); rep = oldRep; if(count==3) return; // we have enough if(i!=size-1) name.append(operator); } }
public Iterator<T> modelGroup(XSModelGroup group) { // compensate for particles that are ignored in SCD return new Iterators.Map<T,XSParticle>(group.iterator()) { protected Iterator<? extends T> apply(XSParticle p) { return particle(p); } }; }
XSParticle p; if (term != null && term.isModelGroup()) { modelGroup = term.asModelGroup(); if (XSModelGroup.CHOICE.equals(modelGroup.getCompositor())) { goingup = false; ps = modelGroup.getChildren(); for (int i = 0; i < ps.length; i++) { p = ps[i]; term = p.getTerm(); if (term.isModelGroup()) { write(st, term, goingup, xss); } else if (term.isElementDecl()) { st.addField(term.asElementDecl().getName(), ns, typeName, (goingup && p.getMinOccurs() .intValue() != 0), p.getMaxOccurs() .intValue() != 1, term.asElementDecl() .getFixedValue(), xsdMapping);
XSTerm term = xsp.getTerm(); if(term.isElementDecl()) { XSComplexType xscmp = (term.asElementDecl()).getType().asComplexType(); if(xsp.getMinOccurs() == 0) hm.put(term.asElementDecl().getName(), "|"); else hm.put(term.asElementDecl().getName(), "="); } else if(term.isModelGroup()){ XSModelGroup model = term.asModelGroup(); XSParticle[] parr = model.getChildren(); for(XSParticle partemp : parr ){ getElementsRecursively(hm, partemp);
private void convertGroup(String mainURI, XSModelGroup group, OntClass parent) { LOGGER.debug("working with group={}, parent={}", group, parent); XSParticle[] particles = group.getChildren(); for (XSParticle p : particles) { XSTerm term = p.getTerm(); if (term.isElementDecl()) { XSElementDecl element = term.asElementDecl(); Property prop = null; if (element.getType().isSimpleType()) { int minOccurs = p.getMinOccurs().intValue(); int maxOccurs = p.getMaxOccurs().intValue(); if (maxOccurs == 1) { if (minOccurs == 1) { } else if (term.isModelGroup()) { convertGroup(mainURI, term.asModelGroup(), parent); } else if (term.isModelGroupDecl()) {
/** * Determine whether the definition contains xsd:any (directly or indirectly) */ private boolean isAny(XSTerm term) { if (term.isWildcard()) { return true; } if (term.isModelGroup()) { XSParticle[] children = term.asModelGroup().getChildren(); if (children != null) { for (XSParticle childParticle : children) { XSTerm childTerm = childParticle.getTerm(); if (childTerm != null) { if (isAny(childTerm)) { return true; } } } } } return 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); }
occurs = " MinOccurs = " + particle.getMinOccurs() + ", MaxOccurs = " + particle.getMaxOccurs() + ", Repeats = " + Boolean.toString(repeats); XSTerm term = particle.getTerm(); if (term.isModelGroup()) printGroup(term.asModelGroup(), occurs, absPath, indent); else if(term.isModelGroupDecl()) printGroupDecl(term.asModelGroupDecl(), occurs, absPath, indent); System.out.println(indent + "[Start of Group " + modelGroup.getCompositor() + occurs + "]" ); for (XSParticle particle : modelGroup.getChildren()) System.out.println(indent + "[End of Group " + modelGroup.getCompositor() + "]");
Boolean inherited, XSContentType explicitContent) throws SchemaException { XSParticle[] particles = group.getChildren(); for (XSParticle p : particles) { boolean particleInherited = inherited != null ? inherited : (p != explicitContent); XSTerm pterm = p.getTerm(); if (pterm.isModelGroup()) { addPropertyDefinitionListFromGroup(pterm.asModelGroup(), ctd, particleInherited, explicitContent); if (pterm.isElementDecl()) { XSAnnotation annotation = selectAnnotationToUse(p.getAnnotation(), pterm.getAnnotation()); XSElementDecl elementDecl = pterm.asElementDecl(); QName elementName = new QName(elementDecl.getTargetNamespace(), elementDecl.getName()); QName typeFromAnnotation = getTypeAnnotation(p.getAnnotation());
XSParticle[] group = mg.getChildren(); if (group.length == 0) { return null; if (group.length == 1 && superType == null && group[0].isRepeated()) { XSTerm term = child.getTerm(); XSElementDecl element = term.asElementDecl(); int maxOccur = child.getMaxOccurs().intValue(); term.asModelGroup()); ct.addField(fieldName, listType, null, 0, null); } else { processModelGroup(schema, superType, name, ct, term.asModelGroup(), abstractType);
private boolean containingChoice(CClassInfo typeBean) { XSComponent component = typeBean.getSchemaComponent(); if (component instanceof XSComplexType) { XSContentType contentType = ((XSComplexType) component).getContentType(); XSParticle particle = contentType.asParticle(); if (particle != null) { XSTerm term = particle.getTerm(); XSModelGroup modelGroup = term.asModelGroup(); if (modelGroup != null) { return (modelGroup.getCompositor() == XSModelGroup.Compositor.CHOICE); } } } return false; }
/** * Creates node for model group with additional attributes. * * @param group Model group. * @param extraAtts Additional attributes. */ private void modelGroup(XSModelGroup group, String extraAtts) { SchemaTreeNode newNode = new SchemaTreeNode(MessageFormat.format( "{0}{1}", new Object[]{group.getCompositor(), extraAtts}), group.getLocator()); this.currNode.add(newNode); this.currNode = newNode; final int len = group.getSize(); for (int i = 0; i < len; i++) { particle(group.getChild(i)); } this.currNode = (SchemaTreeNode) this.currNode.getParent(); }
public void modelGroup(XSModelGroup group) { for (XSParticle child : group.getChildren()) { child.visit(this); } }
private void modelGroup( XSModelGroup group, String extraAtts ) { println(MessageFormat.format("<{0}{1}>", group.getCompositor(), extraAtts)); indent++; final int len = group.getSize(); for( int i=0; i<len; i++ ) particle(group.getChild(i)); indent--; println(MessageFormat.format("</{0}>", group.getCompositor())); }
public void modelGroup(XSModelGroup group) { if(!visited.add(group)) return; for (XSParticle p : group.getChildren()) { particle(p); } }
protected void processGroup(XSModelGroup modelGroup, ParseContext parseContext) throws Exception { logger.info(parseContext.indent + "[Start of " + modelGroup.getCompositor() + parseContext.getOccurs() + "]"); for (XSParticle particle : modelGroup.getChildren()) { ParseContext newParseContext = new ParseContext(); newParseContext.indent = parseContext.indent + "\t"; newParseContext.path = parseContext.path; newParseContext.currentClass = parseContext.currentClass; particle.setMaxOccurs(BigInteger.valueOf(parseContext.maxOccurs.intValue())); particle.setMinOccurs(BigInteger.valueOf(parseContext.minOccurs.intValue())); processParticle(particle, newParseContext); } logger.info(parseContext.indent + "[End of " + modelGroup.getCompositor() + "]"); }
private Iterator<XSModelGroup> filter(XSModelGroup mg) { if(mg==null) return empty(); if(mg.getCompositor() == compositor || compositor == null) return singleton(mg); else return empty(); }