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); }
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); }
/** * Creates a QName from a string, such as "ns:Element". */ protected QName createQName(Element e, String value) { if (value == null || value.length() == 0) { return null; } int index = value.indexOf(":"); if (index == -1) { return new QName(getTypeMapping().getMappingIdentifierURI(), value); } String prefix = value.substring(0, index); String localName = value.substring(index + 1); String ns = DOMUtils.getNamespace(e, prefix); if (ns == null || localName == null) { throw new DatabindingException("Invalid QName in mapping: " + value); } return new QName(ns, localName, prefix); } }
/** * Creates a QName from a string, such as "ns:Element". */ protected QName createQName(Element e, String value) { if (value == null || value.length() == 0) { return null; } int index = value.indexOf(":"); if (index == -1) { return new QName(getTypeMapping().getMappingIdentifierURI(), value); } String prefix = value.substring(0, index); String localName = value.substring(index + 1); String ns = DOMUtils.getNamespace(e, prefix); if (ns == null || localName == null) { throw new DatabindingException("Invalid QName in mapping: " + value); } return new QName(ns, localName, prefix); } }
protected QName createCollectionQName(TypeClassInfo info, AegisType type) { String ns; if (type.isComplex()) { ns = type.getSchemaType().getNamespaceURI(); } else { ns = tm.getMappingIdentifierURI(); } if (WSDLConstants.NS_SCHEMA_XSD.equals(ns)) { ns = HTTP_CXF_APACHE_ORG_ARRAYS; } String first = type.getSchemaType().getLocalPart().substring(0, 1); String last = type.getSchemaType().getLocalPart().substring(1); String localName = "ArrayOf" + first.toUpperCase() + last; if (info.nonDefaultAttributes()) { localName += "-"; if (info.getMinOccurs() >= 0) { localName += info.getMinOccurs(); } localName += "-"; if (info.getMaxOccurs() >= 0) { localName += info.getMaxOccurs(); } if (info.isFlat()) { localName += "Flat"; } } return new QName(ns, localName); }
protected QName createCollectionQName(TypeClassInfo info, AegisType type) { String ns; if (type.isComplex()) { ns = type.getSchemaType().getNamespaceURI(); } else { ns = tm.getMappingIdentifierURI(); } if (WSDLConstants.NS_SCHEMA_XSD.equals(ns)) { ns = HTTP_CXF_APACHE_ORG_ARRAYS; } String first = type.getSchemaType().getLocalPart().substring(0, 1); String last = type.getSchemaType().getLocalPart().substring(1); String localName = "ArrayOf" + first.toUpperCase() + last; if (info.nonDefaultAttributes()) { localName += "-"; if (info.getMinOccurs() >= 0) { localName += info.getMinOccurs(); } localName += "-"; if (info.getMaxOccurs() >= 0) { localName += info.getMaxOccurs(); } if (info.isFlat()) { localName += "Flat"; } } return new QName(ns, localName); }
protected Element findMapping(Type type) { // We are not prepared to find .aegis.xml files for Parameterized types. Class<?> clazz = TypeUtil.getTypeClass(type, false); if (clazz == null) { return null; } Document doc = getDocument(clazz); if (doc == null) { return null; } Element mapping = getMatch(doc, "/mappings/mapping[@uri='" + getTypeMapping().getMappingIdentifierURI() + "']"); if (mapping == null) { mapping = getMatch(doc, "/mappings/mapping[not(@uri)]"); } return mapping; }
protected Element findMapping(Type type) { // We are not prepared to find .aegis.xml files for Parameterized types. Class<?> clazz = TypeUtil.getTypeClass(type, false); if (clazz == null) { return null; } Document doc = getDocument(clazz); if (doc == null) { return null; } Element mapping = getMatch(doc, "/mappings/mapping[@uri='" + getTypeMapping().getMappingIdentifierURI() + "']"); if (mapping == null) { mapping = getMatch(doc, "/mappings/mapping[not(@uri)]"); } return mapping; }