public static List<XmlSchemaAnnotated> getContentAttributes(XmlSchemaComplexType type, SchemaCollection collection) { List<XmlSchemaAnnotated> results = new ArrayList<>(); QName baseTypeName = getBaseType(type); if (baseTypeName != null) { XmlSchemaComplexType baseType = (XmlSchemaComplexType)collection.getTypeByQName(baseTypeName); // recurse onto the base type ... results.addAll(getContentAttributes(baseType, collection)); // and now process our sequence. List<XmlSchemaAttributeOrGroupRef> extAttrs = getContentAttributes(type); results.addAll(extAttrs); return results; } // no base type, the simple case. List<XmlSchemaAttributeOrGroupRef> attrs = type.getAttributes(); results.addAll(attrs); return results; }
public static List<XmlSchemaAnnotated> getContentAttributes(XmlSchemaComplexType type, SchemaCollection collection) { List<XmlSchemaAnnotated> results = new ArrayList<>(); QName baseTypeName = getBaseType(type); if (baseTypeName != null) { XmlSchemaComplexType baseType = (XmlSchemaComplexType)collection.getTypeByQName(baseTypeName); // recurse onto the base type ... results.addAll(getContentAttributes(baseType, collection)); // and now process our sequence. List<XmlSchemaAttributeOrGroupRef> extAttrs = getContentAttributes(type); results.addAll(extAttrs); return results; } // no base type, the simple case. List<XmlSchemaAttributeOrGroupRef> attrs = type.getAttributes(); results.addAll(attrs); return results; }
public static List<XmlSchemaAnnotated> getContentAttributes(XmlSchemaComplexType type, SchemaCollection collection) { List<XmlSchemaAnnotated> results = new ArrayList<XmlSchemaAnnotated>(); QName baseTypeName = getBaseType(type); if (baseTypeName != null) { XmlSchemaComplexType baseType = (XmlSchemaComplexType)collection.getTypeByQName(baseTypeName); // recurse onto the base type ... results.addAll(getContentAttributes(baseType, collection)); // and now process our sequence. List<XmlSchemaAttributeOrGroupRef> extAttrs = getContentAttributes(type); results.addAll(extAttrs); return results; } else { // no base type, the simple case. List<XmlSchemaAttributeOrGroupRef> attrs = type.getAttributes(); results.addAll(attrs); return results; } }
public static List<XmlSchemaAnnotated> getContentAttributes(XmlSchemaComplexType type, SchemaCollection collection) { List<XmlSchemaAnnotated> results = new ArrayList<XmlSchemaAnnotated>(); QName baseTypeName = getBaseType(type); if (baseTypeName != null) { XmlSchemaComplexType baseType = (XmlSchemaComplexType)collection.getTypeByQName(baseTypeName); // recurse onto the base type ... results.addAll(getContentAttributes(baseType, collection)); // and now process our sequence. List<XmlSchemaAttributeOrGroupRef> extAttrs = getContentAttributes(type); results.addAll(extAttrs); return results; } else { // no base type, the simple case. List<XmlSchemaAttributeOrGroupRef> attrs = type.getAttributes(); results.addAll(attrs); return results; } }
public static List<XmlSchemaAnnotated> getContentAttributes(XmlSchemaComplexType type, SchemaCollection collection) { List<XmlSchemaAnnotated> results = new ArrayList<XmlSchemaAnnotated>(); QName baseTypeName = getBaseType(type); if (baseTypeName != null) { XmlSchemaComplexType baseType = (XmlSchemaComplexType)collection.getTypeByQName(baseTypeName); // recurse onto the base type ... results.addAll(getContentAttributes(baseType, collection)); // and now process our sequence. List<XmlSchemaAttributeOrGroupRef> extAttrs = getContentAttributes(type); results.addAll(extAttrs); return results; } else { // no base type, the simple case. List<XmlSchemaAttributeOrGroupRef> attrs = type.getAttributes(); results.addAll(attrs); return results; } }
public void complexTypeConstructorAndAccessors(QName name, XmlSchemaComplexType type) { accessors = new StringBuilder(); utils = new JavascriptUtils(code); List<XmlSchemaObject> items = JavascriptUtils.getContentElements(type, xmlSchemaCollection); List<XmlSchemaAnnotated> attrs = XmlSchemaUtils.getContentAttributes(type, xmlSchemaCollection); final String elementPrefix = "this._"; String typeObjectName = nameManager.getJavascriptName(name); code.append("//\n"); code.append("// Constructor for XML Schema item " + name.toString() + "\n"); code.append("//\n"); code.append("function " + typeObjectName + " () {\n"); // to assist in debugging we put a type property into every object. utils.appendLine("this.typeMarker = '" + typeObjectName + "';"); for (XmlSchemaObject thing : items) { ParticleInfo itemInfo = ParticleInfo.forLocalItem(thing, xmlSchema, xmlSchemaCollection, prefixAccumulator, type.getQName()); constructItem(type, elementPrefix, typeObjectName, itemInfo); } for (XmlSchemaAnnotated thing : attrs) { AttributeInfo itemInfo = AttributeInfo.forLocalItem(thing, xmlSchema, xmlSchemaCollection, prefixAccumulator, type.getQName()); constructOneItem(type, elementPrefix, typeObjectName, itemInfo); } code.append("}\n\n"); code.append(accessors.toString()); }