XMLDescriptor d = null; if (!isGlobalType) { d = getDescriptor(qName); } else { XPathFragment frag = new XPathFragment();
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session) throws XMLMarshalException { XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); QName rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } return xmlDescriptor; }
XMLDescriptor d = null; if (!isGlobalType) { d = getDescriptor(qName); } else { XPathFragment frag = new XPathFragment();
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session) throws XMLMarshalException { XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); QName rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } return xmlDescriptor; }
/** * Get the XML descriptor for the entity class corresponding to the SDO type. */ XMLDescriptor getObjectDescriptor(SDOType sdoType) { QName xsdQName = sdoType.getXsdType(); if(null == xsdQName) { xsdQName = sdoType.getQName(); } XPathFragment xPathFragment = new XPathFragment(xsdQName.getLocalPart()); xPathFragment.setNamespaceURI(xsdQName.getNamespaceURI()); XMLDescriptor xmlDescriptor = jaxbContext.getXMLContext().getDescriptorByGlobalType(xPathFragment); if (null == xmlDescriptor) { xmlDescriptor = jaxbContext.getXMLContext().getDescriptor(xsdQName); if (null == xmlDescriptor) { throw SDOException.sdoJaxbNoDescriptorForType(sdoType.getQName(), xsdQName); } } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session) throws XMLMarshalException { XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); QName rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } return xmlDescriptor; }
/** * Get the XML descriptor for the entity class corresponding to the SDO type. */ XMLDescriptor getObjectDescriptor(SDOType sdoType) { QName xsdQName = sdoType.getXsdType(); if(null == xsdQName) { xsdQName = sdoType.getQName(); } XPathFragment xPathFragment = new XPathFragment(xsdQName.getLocalPart()); xPathFragment.setNamespaceURI(xsdQName.getNamespaceURI()); XMLDescriptor xmlDescriptor = jaxbContext.getXMLContext().getDescriptorByGlobalType(xPathFragment); if (null == xmlDescriptor) { xmlDescriptor = jaxbContext.getXMLContext().getDescriptor(xsdQName); if (null == xmlDescriptor) { throw SDOException.sdoJaxbNoDescriptorForType(sdoType.getQName(), xsdQName); } } return xmlDescriptor; }
protected XMLDescriptor findReferenceDescriptor(XPathFragment xPathFragment, UnmarshalRecord unmarshalRecord, Attributes atts, DatabaseMapping mapping, UnmarshalKeepAsElementPolicy policy) { XMLDescriptor referenceDescriptor = super.findReferenceDescriptor(xPathFragment, unmarshalRecord, atts, mapping, policy); if (referenceDescriptor == null) { XMLContext xmlContext = unmarshalRecord.getUnmarshaller().getXMLContext(); QName qname = new QName(xPathFragment.getNamespaceURI(), xPathFragment.getLocalName()); referenceDescriptor = xmlContext.getDescriptor(qname); // Check if descriptor is for a wrapper, if it is null it out and let continue if (referenceDescriptor != null && referenceDescriptor.isWrapper()) { referenceDescriptor = null; } } return referenceDescriptor; }
/** * INTERNAL: Return the descriptor for the document. */ protected XMLDescriptor getDescriptor(DOMRecord xmlRecord) throws XMLMarshalException { XMLDescriptor xmlDescriptor = null; XMLContext xmlContext = xmlUnmarshaller.getXMLContext(); // Try to find a descriptor based on the schema type String type = ((Element) xmlRecord.getDOM()).getAttributeNS(XMLConstants.SCHEMA_INSTANCE_URL, "type"); if (null != type) { XPathFragment typeFragment = new XPathFragment(type); String namespaceURI = xmlRecord.resolveNamespacePrefix(typeFragment.getPrefix()); typeFragment.setNamespaceURI(namespaceURI); xmlDescriptor = xmlContext.getDescriptorByGlobalType(typeFragment); } if (null == xmlDescriptor) { QName rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(rootQName.toString()); } } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session, QName rootQName) throws XMLMarshalException { if (rootQName == null) { rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); } XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { if (!(getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT || getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session, QName rootQName) throws XMLMarshalException { if (rootQName == null) { rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); } XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { if (!(getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT || getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session, QName rootQName) throws XMLMarshalException { if (rootQName == null) { rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); } XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { if (!((getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) || (getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT))) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session, QName rootQName) throws XMLMarshalException { if (rootQName == null) { rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); } XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { if (!(getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT || getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session, QName rootQName) throws XMLMarshalException { if (rootQName == null) { rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); } XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { if (!((getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) || (getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT))) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session, QName rootQName) throws XMLMarshalException { if (rootQName == null) { rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); } XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { if (!((getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) || (getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT))) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session, QName rootQName) throws XMLMarshalException { if (rootQName == null) { rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); } XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { if (!((getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) || (getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT))) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session, QName rootQName) throws XMLMarshalException { if (rootQName == null) { rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); } XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { if (!((getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) || (getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT))) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session, QName rootQName) throws XMLMarshalException { if (rootQName == null) { rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); } XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { if (!((getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) || (getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT))) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } } return xmlDescriptor; }
XMLDescriptor xdesc = xmlContext.getDescriptor(qName); if (xdesc != null) { return xdesc.getJavaClass() != descriptor.getJavaClass();
if (workingDescriptor == null) { QName qname = new QName(xPathFragment.getNamespaceURI(), xPathFragment.getLocalName()); workingDescriptor = xmlContext.getDescriptor(qname);