private void complexTypeSerializeAttributes(XmlSchemaComplexType type, String string) { @SuppressWarnings("unused") List<XmlSchemaAttributeOrGroupRef> attributes = type.getAttributes(); // work in progress. }
private static boolean hasAttributes(XmlSchemaComplexType complexType) { // Now lets see if we have any attributes... // This should probably look at the restricted and substitute types too. return complexType.getAnyAttribute() != null || !complexType.getAttributes().isEmpty(); }
private static boolean hasAttributes(XmlSchemaComplexType complexType) { // Now lets see if we have any attributes... // This should probably look at the restricted and substitute types too. if (complexType.getAnyAttribute() != null || !complexType.getAttributes().isEmpty()) { return true; } return false; }
public static boolean isUnion(XmlSchemaComplexType type) { boolean isUnion = false; if (type.getParticle() instanceof XmlSchemaChoice && type.getAttributes().isEmpty()) { isUnion = true; } return isUnion; }
private boolean hasAttributes(XmlSchemaComplexType complexType) { // Now lets see if we have any attributes... // This should probably look at the restricted and substitute types too. return complexType.getAnyAttribute() != null || complexType.getAttributes().size() > 0; }
private static boolean hasAttributes(XmlSchemaComplexType complexType) { // Now lets see if we have any attributes... // This should probably look at the restricted and substitute types too. if (complexType.getAnyAttribute() != null || !complexType.getAttributes().isEmpty()) { return true; } return false; }
protected static boolean hasAttributes(XmlSchemaComplexType complexType) { // Now lets see if we have any attributes... // This should probably look at the restricted and substitute types too. if (complexType.getAnyAttribute() != null || complexType.getAttributes().getCount() > 0) return true; else return false; }
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 static boolean isOMGUnion(XmlSchemaComplexType type) { boolean isUnion = false; if (type.getParticle() instanceof XmlSchemaSequence && type.getAttributes().isEmpty()) { XmlSchemaSequence stype = (XmlSchemaSequence)type.getParticle(); if (stype.getItems().size() == 2) { XmlSchemaParticle st1 = (XmlSchemaParticle)stype.getItems().get(0); XmlSchemaParticle st2 = (XmlSchemaParticle)stype.getItems().get(1); XmlSchemaElement discEl = null; if (st1 instanceof XmlSchemaChoice && st2 instanceof XmlSchemaElement) { isUnion = true; discEl = (XmlSchemaElement)st2; } else if (st2 instanceof XmlSchemaChoice && st1 instanceof XmlSchemaElement) { isUnion = true; discEl = (XmlSchemaElement)st1; } if (isUnion && !"discriminator".equals(discEl.getQName().getLocalPart())) { isUnion = false; } } } return isUnion; }
private void processAttributes(XmlSchemaComplexType complexType, AxisMessage message, List partNameList, String qnameSuffix) { QName opName = message.getAxisOperation().getName(); XmlSchemaAttribute xmlSchemaAttribute; for (XmlSchemaObject item : complexType.getAttributes()) { if (item instanceof XmlSchemaAttribute) { xmlSchemaAttribute = (XmlSchemaAttribute) item; String partName = xmlSchemaAttribute.getName(); partNameList.add( WSDLUtil.getPartQName(opName.getLocalPart(), qnameSuffix, partName)); } } }
private static void processAttributes(XmlSchemaComplexType complexType, String opName, String qnameSuffix, TypeMapper typeMap) { for (XmlSchemaObject item : complexType.getAttributes()) { XmlSchemaAttribute xmlSchemaAttribute; if (item instanceof XmlSchemaAttribute) { xmlSchemaAttribute = (XmlSchemaAttribute) item; populateClassName(xmlSchemaAttribute.getMetaInfoMap(), typeMap, opName, false, xmlSchemaAttribute.getName(), qnameSuffix); } } }
private static void processAttributes(XmlSchemaComplexType complexType, String opName, String qnameSuffix, TypeMapper typeMap) { for (XmlSchemaObject item : complexType.getAttributes()) { XmlSchemaAttribute xmlSchemaAttribute; if (item instanceof XmlSchemaAttribute) { xmlSchemaAttribute = (XmlSchemaAttribute) item; populateClassName(xmlSchemaAttribute.getMetaInfoMap(), typeMap, opName, false, xmlSchemaAttribute.getName(), qnameSuffix); } } }
public boolean isLiteralArray(XmlSchemaComplexType type) { boolean array = false; if ((type.getAttributes().isEmpty()) && (type.getParticle() instanceof XmlSchemaSequence)) { XmlSchemaSequence stype = (XmlSchemaSequence)type.getParticle(); if ((stype.getItems().size() == 1) && (stype.getItems().get(0) instanceof XmlSchemaElement)) { XmlSchemaElement el = (XmlSchemaElement)stype.getItems().get(0); if (!(el.getMaxOccurs() == 1)) { // it's a literal array array = true; } if (el.getMaxOccurs() == 1 && el.getMinOccurs() == 1 && type.getName() != null && WSDLTypes.isAnonymous(type.getName())) { array = true; } } } return array; }
private static XmlSchemaObjectCollection getSchemaObjectsFromComplexType(XmlSchemaComplexType schemaComplexType) { XmlSchemaObjectCollection collection = new XmlSchemaObjectCollection(); XmlSchemaSequence sequence = (XmlSchemaSequence) schemaComplexType.getParticle(); if (sequence != null) { XmlSchemaObjectCollection seqItems = sequence.getItems(); int c = seqItems.getCount(); for (int i = 0; i < c; i++) { // add elements collection.add(seqItems.getItem(i)); } } XmlSchemaObjectCollection attrItems = schemaComplexType.getAttributes(); int c = attrItems.getCount(); for (int i = 0; i < c; i++) { // add attributes collection.add(attrItems.getItem(i)); } return collection; }
private void addCrossImportsType(XmlSchema schema, XmlSchemaType schemaType) { // the base type might cross schemas. if (schemaType instanceof XmlSchemaComplexType) { XmlSchemaComplexType complexType = (XmlSchemaComplexType)schemaType; XmlSchemaUtils.addImportIfNeeded(schema, complexType.getBaseSchemaTypeName()); addCrossImports(schema, complexType.getContentModel()); addCrossImportsAttributeList(schema, complexType.getAttributes()); // could it be a choice or something else? if (complexType.getParticle() instanceof XmlSchemaChoice) { XmlSchemaChoice choice = XmlSchemaUtils.getChoice(complexType); addCrossImports(schema, choice); } else if (complexType.getParticle() instanceof XmlSchemaAll) { XmlSchemaAll all = XmlSchemaUtils.getAll(complexType); addCrossImports(schema, all); } else { XmlSchemaSequence sequence = XmlSchemaUtils.getSequence(complexType); addCrossImports(schema, sequence); } } } private void addCrossImports(XmlSchema schema, XmlSchemaAll all) {
private void addCrossImportsType(XmlSchema schema, XmlSchemaType schemaType) { // the base type might cross schemas. if (schemaType instanceof XmlSchemaComplexType) { XmlSchemaComplexType complexType = (XmlSchemaComplexType)schemaType; XmlSchemaUtils.addImportIfNeeded(schema, complexType.getBaseSchemaTypeName()); addCrossImports(schema, complexType.getContentModel()); addCrossImportsAttributeList(schema, complexType.getAttributes()); // could it be a choice or something else? if (complexType.getParticle() instanceof XmlSchemaChoice) { XmlSchemaChoice choice = (XmlSchemaChoice)complexType.getParticle(); addCrossImports(schema, choice); } else if (complexType.getParticle() instanceof XmlSchemaAll) { XmlSchemaAll all = (XmlSchemaAll)complexType.getParticle(); addCrossImports(schema, all); } else if (complexType.getParticle() instanceof XmlSchemaSequence) { XmlSchemaSequence sequence = (XmlSchemaSequence)complexType.getParticle(); addCrossImports(schema, sequence); } } } private void addCrossImports(XmlSchema schema, XmlSchemaAll all) {