/** * Obtain a suitable name for use in Javascript for an attribute. This function * is purely a tribute to the awful modularity of XmlSchema. * @param attribute * @param qualified * @return */ public String xmlAttributeString(XmlSchemaAttribute attribute, boolean qualified) { if (qualified) { // What if there were a prefix in the element's qname? This is not apparently // something that happens in this environment. String prefix = getPrefix(attribute.getQName().getNamespaceURI()); collect(prefix, attribute.getQName().getNamespaceURI()); return prefix + ":" + attribute.getName(); } return attribute.getName(); // use the non-qualified name. }
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); } } }
/** * Adds the given parameter to the complex type. * @param complexType The complex type which the attribute will be added to * @param name The name of the attribute * @param xsdType The type of the attribute */ @SuppressWarnings("unchecked") private static void addAttributeToComplexType(XmlSchemaComplexType complexType, String name, QName xsdType) { XmlSchemaAttribute attr = new XmlSchemaAttribute(); attr.setName(name); attr.setSchemaTypeName(xsdType); attr.setUse(new XmlSchemaUse("optional")); XmlSchemaAttribute tmpAttr; for (Iterator<XmlSchemaAttribute> itr = complexType.getAttributes().getIterator(); itr.hasNext();) { tmpAttr = itr.next(); if (tmpAttr.getName().equals(attr.getName())) { /* current attribute is already set, nothing more to do */ return; } } complexType.getAttributes().add(attr); }