private ElementBinding findLocalPathElementInTypes(Iterator types, String[] path) { while (types.hasNext()) { TypeBinding type = (TypeBinding)types.next(); if (type.getQName().getLocalPart().equals(path[0])) { ParticleBinding particle = type.getParticle(); if (particle == null) continue; TermBinding term = particle.getTerm(); if (!term.isModelGroup()) continue; return findLocalPathElement(((ModelGroupBinding)term).getParticles().iterator(), path, 1); } } return null; }
private static boolean isArrayWrapper(TypeBinding type) { boolean is = false; if(!type.isSimple()) { ParticleBinding particle = type.getParticle(); if(particle != null) { is = particle.getMaxOccursUnbounded() || particle.getMaxOccurs() > 1; } } return is; }
private ElementBinding findLocalPathElement(ElementBinding element, String[] path, int pos) { String name = path[pos]; if (!name.equals(element.getQName().getLocalPart())) return null; // End of path if (path.length - 1 == pos) return element; ParticleBinding particle = element.getType().getParticle(); if (particle == null) return null; TermBinding term = particle.getTerm(); if (!term.isModelGroup()) return null; ModelGroupBinding group = (ModelGroupBinding)term; Iterator i = group.getParticles().iterator(); // Increase depth return findLocalPathElement(i, path, pos + 1); }
private static void addXOPInclude(TypeBinding binding, SchemaBinding schema) { binding.setHandler(DefaultHandlers.XOP_HANDLER); if(binding.getParticle() != null) { throw new JBossXBRuntimeException( "XOP optimizable type has a particle which is unexpected, please, open a JIRA issue!" ); } TypeBinding anyUriType = schema.getType(Constants.QNAME_ANYURI); if(anyUriType == null) { log.warn("Type " + Constants.QNAME_ANYURI + " not bound."); } TypeBinding xopIncludeType = new TypeBinding(new QName(Constants.NS_XOP_INCLUDE, "Include")); xopIncludeType.setSchemaBinding(schema); xopIncludeType.addAttribute(new QName("href"), anyUriType, DefaultHandlers.ATTRIBUTE_HANDLER); xopIncludeType.setHandler(new XOPIncludeHandler(binding)); ElementBinding xopInclude = new ElementBinding(schema, new QName(Constants.NS_XOP_INCLUDE, "Include"), xopIncludeType); ParticleBinding particleBinding = new ParticleBinding(xopInclude); particleBinding.setMinOccurs(0); binding.addParticle(particleBinding); }
if(!type.isSimple() && type.getAttributes().isEmpty()) ParticleBinding typeParticle = type.getParticle(); ModelGroupBinding modelGroup = (ModelGroupBinding)(typeParticle == null ? null : typeParticle.getTerm()); arrayItem = modelGroup == null ? null : modelGroup.getArrayItem();
ParticleBinding particle = typeBinding.getParticle(); if (particle != null)
content.startElement(elementNs, elementLocal, qName, ctx.attrs); ParticleBinding particle = type.getParticle(); if(particle != null)
if(type.getAttributes().isEmpty()) ParticleBinding typeParticle = type.getParticle(); ModelGroupBinding modelGroup = (ModelGroupBinding)(typeParticle == null ? null : typeParticle.getTerm()); arrayItem = modelGroup == null ? null : modelGroup.getArrayItem();
ParticleBinding typeParticle = parentType.getParticle(); ModelGroupBinding modelGroup = typeParticle == null ? null : (ModelGroupBinding)typeParticle.getTerm(); if(modelGroup == null)