/** * Determine whether the definition contains "list" attribute (directly or indirectly) */ private boolean isList(XSComplexType complexType) { Collection<? extends XSAttributeUse> attributeUses = complexType.getAttributeUses(); return attributeUses != null && attributeUses.stream() .anyMatch(au -> au.getDecl() != null && DOMUtil.IS_LIST_ATTRIBUTE_NAME.equals(au.getDecl().getName())); }
public void complexType(XSComplexType type) { if (shouldWalk && visited.add(type.getContentType())) { type.getContentType().visit(this); for (XSAttributeUse u : type.getAttributeUses()) if (shouldWalk && visited.add(u)) attributeUse(u); } }
public Collection<XSAttributeUse> getAttributeUses() { XSComplexType baseType = getBaseType().asComplexType(); if( baseType==null ) return super.getAttributeUses(); // TODO: this is fairly inefficient Map<UName,XSAttributeUse> uses = new HashMap<UName, XSAttributeUse>(); for( XSAttributeUse a : baseType.getAttributeUses()) uses.put(new UName(a.getDecl()),a); uses.keySet().removeAll(prohibitedAtts); for( XSAttributeUse a : super.getAttributeUses()) uses.put(new UName(a.getDecl()),a); return uses.values(); }
public Collection<XSAttributeUse> getAttributeUses() { XSComplexType baseType = getBaseType().asComplexType(); if( baseType==null ) return super.getAttributeUses(); // TODO: this is fairly inefficient Map<UName,XSAttributeUse> uses = new HashMap<UName, XSAttributeUse>(); for( XSAttributeUse a : baseType.getAttributeUses()) uses.put(new UName(a.getDecl()),a); uses.keySet().removeAll(prohibitedAtts); for( XSAttributeUse a : super.getAttributeUses()) uses.put(new UName(a.getDecl()),a); return uses.values(); }
public Collection<XSAttributeUse> getAttributeUses() { XSComplexType baseType = getBaseType().asComplexType(); if( baseType==null ) return super.getAttributeUses(); // TODO: this is fairly inefficient Map<UName,XSAttributeUse> uses = new HashMap<UName, XSAttributeUse>(); for( XSAttributeUse a : baseType.getAttributeUses()) uses.put(new UName(a.getDecl()),a); uses.keySet().removeAll(prohibitedAtts); for( XSAttributeUse a : super.getAttributeUses()) uses.put(new UName(a.getDecl()),a); return uses.values(); }
public Collection<XSAttributeUse> getAttributeUses() { XSComplexType baseType = getBaseType().asComplexType(); if( baseType==null ) return super.getAttributeUses(); // TODO: this is fairly inefficient Map<UName,XSAttributeUse> uses = new HashMap<UName, XSAttributeUse>(); for( XSAttributeUse a : baseType.getAttributeUses()) uses.put(new UName(a.getDecl()),a); uses.keySet().removeAll(prohibitedAtts); for( XSAttributeUse a : super.getAttributeUses()) uses.put(new UName(a.getDecl()),a); return uses.values(); }
public Collection<XSAttributeUse> getAttributeUses() { XSComplexType baseType = getBaseType().asComplexType(); if( baseType==null ) return super.getAttributeUses(); // TODO: this is fairly inefficient Map<UName,XSAttributeUse> uses = new HashMap<UName, XSAttributeUse>(); for( XSAttributeUse a : baseType.getAttributeUses()) uses.put(new UName(a.getDecl()),a); uses.keySet().removeAll(prohibitedAtts); for( XSAttributeUse a : super.getAttributeUses()) uses.put(new UName(a.getDecl()),a); return uses.values(); }
// To get ComplexType attributes private static void getComplexAttributes(XSComplexType xsComplexType) { Collection<? extends XSAttributeUse> c = xsComplexType.getAttributeUses(); Iterator<? extends XSAttributeUse> i = c.iterator(); while(i.hasNext()) { // i.next is attributeUse XSAttributeUse attUse = i.next(); System.out.println("Attributes for CoplexType:"+ xsComplexType.getName()); parseAttribute(attUse); } } // To Get attribute info private static void parseAttribute(XSAttributeUse attUse) { XSAttributeDecl attributeDecl = attUse.getDecl(); System.out.println("Attribute Name:"+attributeDecl.getName()); XSSimpleType xsAttributeType = attributeDecl.getType(); System.out.println("Attribute Type: " + xsAttributeType.getName()); if (attUse.isRequired()) System.out.println("Use: Required"); else System.out.println("Use: Optional"); System.out.println("Fixed: " + attributeDecl.getFixedValue()); System.out.println("Default: " + attributeDecl.getDefaultValue()); }
protected void processComplexType(XSComplexType complexType, ParseContext parseContext) throws Exception { XSParticle particle = complexType.getContentType().asParticle(); if (particle != null) { processParticle(particle, parseContext); } XSSimpleType xsSimpleType = complexType.getContentType().asSimpleType(); if (xsSimpleType != null) { processText("value", xsSimpleType, parseContext); } Collection<? extends XSAttributeUse> c = complexType.getAttributeUses(); Iterator<? extends XSAttributeUse> i = c.iterator(); while(i.hasNext()) { XSAttributeUse attUse = i.next(); processAttribute(attUse, parseContext); } }
private void write(Struct st, XSComplexType type, boolean goingup, XSSchemaSet xss) { XSParticle particle; Iterator<? extends XSAttributeUse> it; XSAttributeUse att; XSAttributeDecl decl; Iterator<? extends XSAttGroupDecl> itt; particle = type.getContentType().asParticle(); if (particle != null) { write(st, particle.getTerm(), true, xss); } itt = type.getAttGroups().iterator(); while (itt.hasNext()) { write(st, itt.next(), true); } it = type.getAttributeUses().iterator(); while (it.hasNext()) { att = it.next(); decl = att.getDecl(); write(st, decl, goingup && att.isRequired()); } }
itau = type.getAttributeUses().iterator(); while (itau.hasNext()) { att = itau.next();
protected void loadAttributes(Schema schema, XSComplexType xsct, ComplexType ct) throws TypeBindingException { Collection<? extends XSAttributeUse> attrs = xsct.getAttributeUses(); for (XSAttributeUse attr : attrs) { XSAttributeDecl at = attr.getDecl(); Type fieldType = loadType(schema, at.getType(), at.getName()); if (fieldType == null) { throw new TypeBindingException("Cannot add type for '" + at.getName() + "'"); } createField(ct, at, fieldType, !attr.isRequired()); } }
Collection<? extends XSAttributeUse> attributeList = xsComplexType.getAttributeUses(); for (XSAttributeUse attr : attributeList) { XSAttributeDecl attrInfo = attr.getDecl();
Iterator<? extends XSAttributeUse> attributeUses = complex.getAttributeUses().iterator(); while (attributeUses.hasNext()) { XSAttributeUse attributeUse = (XSAttributeUse) attributeUses.next();