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; }
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; }
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; }
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; }
/** * 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; }
throw XMLMarshalException.noDescriptorWithMatchingRootElement(rootQName.toString()); }else{ readSession = xmlContext.getSession(descriptor.getJavaClass());
throw XMLMarshalException.noDescriptorWithMatchingRootElement(rootQName.toString()); }else{ readSession = xmlContext.getSession(descriptor.getJavaClass());
throw XMLMarshalException.noDescriptorWithMatchingRootElement(rootQName.toString()); } else { UnmappedContentHandler unmappedContentHandler;
throw XMLMarshalException.noDescriptorWithMatchingRootElement(rootQName.toString()); } else { UnmappedContentHandler unmappedContentHandler;
throw XMLMarshalException.noDescriptorWithMatchingRootElement(rootQName.toString()); } else { UnmappedContentHandler unmappedContentHandler;