public QName getSchemaType() { return baseType.getSchemaType(); }
public QName getSchemaType() { return baseType.getSchemaType(); }
public static void setAttributeAttributes(QName name, AegisType type, XmlSchema root) { String ns = type.getSchemaType().getNamespaceURI(); XmlSchemaUtils.addImportIfNeeded(root, ns); }
public static void setAttributeAttributes(QName name, AegisType type, XmlSchema root) { String ns = type.getSchemaType().getNamespaceURI(); XmlSchemaUtils.addImportIfNeeded(root, ns); }
public void removeType(AegisType type) { if (!xml2Type.containsKey(type.getSchemaType())) { nextTM.removeType(type); } else { xml2Type.remove(type.getSchemaType()); class2Type.remove(type.getType()); class2xml.remove(type.getType()); } }
protected QName createMapQName(TypeClassInfo info, AegisType keyType, AegisType valueType) { String name = keyType.getSchemaType().getLocalPart() + '2' + valueType.getSchemaType().getLocalPart(); Class<?> cls = TypeUtil.getTypeRelatedClass(info.getType()); name += cls.getSimpleName(); // TODO: Get namespace from XML? return new QName(tm.getMappingIdentifierURI(), name); }
@Override public String toString() { StringBuilder sb = new StringBuilder(getClass().getName()); sb.append("[class="); Class<?> c = getTypeClass(); if (c != null) { sb.append(c.getName()); } else { sb.append("<generic or null>"); } sb.append(",\nQName="); QName q = getSchemaType(); sb.append((q == null) ? "<null>" : q.toString()); sb.append("]"); return sb.toString(); }
/** * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof AegisType) { AegisType type = (AegisType)obj; if (type.getSchemaType().equals(getSchemaType()) && type.getTypeClass().equals(getTypeClass())) { return true; } } return false; }
public void removeType(AegisType type) { if (!xml2Type.containsKey(type.getSchemaType())) { nextTM.removeType(type); } else { xml2Type.remove(type.getSchemaType()); class2Type.remove(type.getType()); class2xml.remove(type.getType()); } }
protected QName createMapQName(TypeClassInfo info, AegisType keyType, AegisType valueType) { String name = keyType.getSchemaType().getLocalPart() + '2' + valueType.getSchemaType().getLocalPart(); Class<?> cls = TypeUtil.getTypeRelatedClass(info.getType()); name += cls.getSimpleName(); // TODO: Get namespace from XML? return new QName(tm.getMappingIdentifierURI(), name); }
@Override public String toString() { StringBuilder sb = new StringBuilder(getClass().getName()); sb.append("[class="); Class<?> c = getTypeClass(); if (c != null) { sb.append(c.getName()); } else { sb.append("<generic or null>"); } sb.append(",\nQName="); QName q = getSchemaType(); sb.append((q == null) ? "<null>" : q.toString()); sb.append("]"); return sb.toString(); }
/** * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof AegisType) { AegisType type = (AegisType)obj; if (type.getSchemaType().equals(getSchemaType()) && type.getTypeClass().equals(getTypeClass())) { return true; } } return false; }
@Override public int hashCode() { int hashcode = 0; if (getTypeClass() != null) { hashcode ^= getTypeClass().hashCode(); } if (getSchemaType() != null) { hashcode ^= getSchemaType().hashCode(); } return hashcode; }
@Override public int hashCode() { int hashcode = 0; if (getTypeClass() != null) { hashcode ^= getTypeClass().hashCode(); } if (getSchemaType() != null) { hashcode ^= getSchemaType().hashCode(); } return hashcode; }
@Override protected XMLStreamReader createStreamReader(AegisType typeToRead, InputStream is) throws Exception { // the namespace map. Oh, the namespace map. // This is wrong, but might make unit tests pass until we redesign. if (typeToRead != null) { String pfx = "ns1"; int count = 1; while (namespaceMap.containsValue(pfx)) { count++; pfx = "ns" + count; } namespaceMap.putIfAbsent(typeToRead.getSchemaType().getNamespaceURI(), pfx); } return JSONUtils.createStreamReader(is, readXsiType, namespaceMap); }
/** * Gets the QName of the root component type of this array. This will be a non-array type such as * a simple xsd type. * @return the QName of the root component type of this array */ protected QName getRootType() { AegisType componentType = getComponentType(); if (componentType instanceof SoapArrayType) { SoapArrayType arrayType = (SoapArrayType) componentType; return arrayType.getRootType(); } return componentType.getSchemaType(); }
/** * Gets the QName of the root component type of this array. This will be a non-array type such as * a simple xsd type. * @return the QName of the root component type of this array */ protected QName getRootType() { AegisType componentType = getComponentType(); if (componentType instanceof SoapArrayType) { SoapArrayType arrayType = (SoapArrayType) componentType; return arrayType.getRootType(); } return componentType.getSchemaType(); }
/** * Creates a element in a sequence for the key type and the value type. */ private void createElement(XmlSchema schema, XmlSchemaSequence seq, QName name, AegisType type, boolean optional) { XmlSchemaElement element = new XmlSchemaElement(schema, false); seq.getItems().add(element); element.setName(name.getLocalPart()); element.setSchemaTypeName(type.getSchemaType()); if (optional) { element.setMinOccurs(0); } else { element.setMinOccurs(1); } element.setMaxOccurs(1); }
/** * Creates a element in a sequence for the key type and the value type. */ private void createElement(XmlSchema schema, XmlSchemaSequence seq, QName name, AegisType type, boolean optional) { XmlSchemaElement element = new XmlSchemaElement(schema, false); seq.getItems().add(element); element.setName(name.getLocalPart()); element.setSchemaTypeName(type.getSchemaType()); if (optional) { element.setMinOccurs(0); } else { element.setMinOccurs(1); } element.setMaxOccurs(1); }
public QName getSuggestedName(Service s, TypeMapping tm, OperationInfo op, int param) { Method m = getMethod(s, op); if (m == null) { return null; } QName name = tm.getTypeCreator().getElementName(m, param); // No mapped name was specified, so if its a complex type use that name // instead if (name == null) { AegisType type = tm.getTypeCreator().createType(m, param); if (type.isComplex() && !type.isAbstract()) { name = type.getSchemaType(); } } return name; }