@Override public Document getDocument() { return marshalRecord.getDocument(); }
@Override public Document getDocument() { return marshalRecord.getDocument(); }
/** * INTERNAL: * Convert the given object to an XML Document * @param object the object to marshal * @return the document which the specified object has been marshalled to * @param descriptor the XMLDescriptor for the object being marshalled * @throws XMLMarshalException if an error occurred during marshalling */ protected Document objectToXML(Object object, DESCRIPTOR descriptor, boolean isXMLRoot) throws XMLMarshalException { ABSTRACT_SESSION session = context.getSession(descriptor); MarshalRecord marshalRecord = new NodeRecord(); marshalRecord.setMarshaller(this); marshal(object, marshalRecord, session, descriptor, isXMLRoot); return marshalRecord.getDocument(); }
/** * INTERNAL: * Convert the given object to an XML Document * @param object the object to marshal * @return the document which the specified object has been marshalled to * @param descriptor the XMLDescriptor for the object being marshalled * @throws XMLMarshalException if an error occurred during marshalling */ protected Document objectToXML(Object object, DESCRIPTOR descriptor, boolean isXMLRoot) throws XMLMarshalException { ABSTRACT_SESSION session = context.getSession(descriptor); MarshalRecord marshalRecord = new NodeRecord(); marshalRecord.setMarshaller(this); marshal(object, marshalRecord, session, descriptor, isXMLRoot); return marshalRecord.getDocument(); }
protected Node objectToXMLNode(Object object, Node rootNode, ABSTRACT_SESSION session, DESCRIPTOR descriptor, boolean isXMLRoot) throws XMLMarshalException { MarshalRecord marshalRecord = new NodeRecord(); marshalRecord.setMarshaller(this); marshalRecord.getNamespaceResolver().setDOM(rootNode); marshal(object, marshalRecord, session, descriptor, isXMLRoot); return marshalRecord.getDocument(); }
protected Node objectToXMLNode(Object object, Node rootNode, ABSTRACT_SESSION session, DESCRIPTOR descriptor, boolean isXMLRoot) throws XMLMarshalException { MarshalRecord marshalRecord = new NodeRecord(); marshalRecord.setMarshaller(this); marshalRecord.getNamespaceResolver().setDOM(rootNode); marshal(object, marshalRecord, session, descriptor, isXMLRoot); return marshalRecord.getDocument(); }
protected Node objectToXMLNode(Object object, Node rootNode, AbstractSession session,XMLDescriptor descriptor, boolean isXMLRoot) throws XMLMarshalException { DocumentPreservationPolicy docPresPolicy = xmlContext.getDocumentPreservationPolicy(session); if (docPresPolicy != null && docPresPolicy.shouldPreserveDocument()) { XMLRecord xmlRow = null; if (!isXMLRoot) { xmlRow = (XMLRecord) ((XMLObjectBuilder) descriptor.getObjectBuilder()).createRecordFor(object, xmlContext.getDocumentPreservationPolicy(session)); xmlRow.setMarshaller(this); if (getAttachmentMarshaller() != null) { xmlRow.setXOPPackage(getAttachmentMarshaller().isXOPPackage()); } if (xmlRow.getDOM().getNodeType() == Node.ELEMENT_NODE) { addDescriptorNamespacesToXMLRecord(descriptor, xmlRow); } } Document doc = objectToXML(object, rootNode, descriptor, xmlRow, isXMLRoot, docPresPolicy); if ((xmlRow != null) && (xmlRow.getDOM().getNodeType() == Node.DOCUMENT_FRAGMENT_NODE)) { return xmlRow.getDOM(); } else { return doc; } } MarshalRecord marshalRecord = new NodeRecord(); marshalRecord.setMarshaller(this); marshalRecord.getNamespaceResolver().setDOM(rootNode); marshal(object, marshalRecord, session, descriptor, isXMLRoot); return marshalRecord.getDocument(); }
marshalRecord.setMarshaller(this); marshal(object, marshalRecord, session, descriptor, isXMLRoot); return marshalRecord.getDocument();
/** * INTERNAL: * Convert the given object to an XML Document * @param object the object to marshal * @return the document which the specified object has been marshalled to * @param descriptor the XMLDescriptor for the object being marshalled * @throws XMLMarshalException if an error occurred during marshalling */ protected Document objectToXML(Object object, XMLDescriptor descriptor, boolean isXMLRoot) throws XMLMarshalException { AbstractSession session = xmlContext.getSession(descriptor); DocumentPreservationPolicy docPresPolicy = xmlContext.getDocumentPreservationPolicy(session); if (docPresPolicy != null && docPresPolicy.shouldPreserveDocument()) { XMLRecord xmlRow = null; if (!isXMLRoot) { xmlRow = (XMLRecord) ((XMLObjectBuilder) descriptor.getObjectBuilder()).createRecordFor(object, xmlContext.getDocumentPreservationPolicy(session)); xmlRow.setMarshaller(this); if (getAttachmentMarshaller() != null) { xmlRow.setXOPPackage(getAttachmentMarshaller().isXOPPackage()); } addDescriptorNamespacesToXMLRecord(descriptor, xmlRow); } return objectToXML(object, descriptor, xmlRow, isXMLRoot, docPresPolicy); } MarshalRecord marshalRecord = new NodeRecord(); marshalRecord.setMarshaller(this); marshal(object, marshalRecord, session, descriptor, isXMLRoot); return marshalRecord.getDocument(); }
marshalRecord.setMarshaller(this); marshal(object, marshalRecord, session, descriptor, isXMLRoot); return marshalRecord.getDocument();
marshalRecord.setMarshaller(this); marshal(object, marshalRecord, session, descriptor, isXMLRoot); return marshalRecord.getDocument();