/** * 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 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; }
btinfo.setTypeMapping(getTypeMapping()); btinfo.setDefaultMinOccurs(getConfiguration().getDefaultMinOccurs()); btinfo.setDefaultNillable(getConfiguration().isDefaultNillable()); type.setTypeMapping(getTypeMapping());
btinfo.setTypeMapping(getTypeMapping()); btinfo.setDefaultMinOccurs(getConfiguration().getDefaultMinOccurs()); btinfo.setDefaultNillable(getConfiguration().isDefaultNillable()); type.setTypeMapping(getTypeMapping());