public void setAttachmentMarshaller(AttachmentMarshaller attachmentMarshaller) { if (attachmentMarshaller == null) { xmlMarshaller.setAttachmentMarshaller(null); } else { xmlMarshaller.setAttachmentMarshaller(new AttachmentMarshallerAdapter(attachmentMarshaller)); } }
@Override public void setAttachmentMarshaller(AttachmentMarshaller attachmentMarshaller) { if (attachmentMarshaller == null) { xmlMarshaller.setAttachmentMarshaller(null); } else { xmlMarshaller.setAttachmentMarshaller(new AttachmentMarshallerAdapter(attachmentMarshaller)); } }
public void serialize(XMLDocument xmlDocument, OutputStream outputStream, Object options) throws IOException { XMLMarshaller xmlMarshaller = getXmlMarshaller(); XMLAttachmentMarshaller attachmentMarshaller = xmlMarshaller.getAttachmentMarshaller(); //temporarily null out the attachment marshaller as it should not be used during serialization xmlMarshaller.setAttachmentMarshaller(null); OutputStreamWriter writer = new OutputStreamWriter(outputStream, xmlMarshaller.getEncoding()); save(xmlDocument, writer, xmlMarshaller); xmlMarshaller.setAttachmentMarshaller(attachmentMarshaller); }
public void serialize(XMLDocument xmlDocument, OutputStream outputStream, Object options) throws IOException { XMLMarshaller xmlMarshaller = getXmlMarshaller(); XMLAttachmentMarshaller attachmentMarshaller = xmlMarshaller.getAttachmentMarshaller(); //temporarily null out the attachment marshaller as it should not be used during serialization xmlMarshaller.setAttachmentMarshaller(null); OutputStreamWriter writer = new OutputStreamWriter(outputStream, xmlMarshaller.getEncoding()); save(xmlDocument, writer, xmlMarshaller); xmlMarshaller.setAttachmentMarshaller(attachmentMarshaller); }
private XMLMarshaller getXmlMarshaller(Object options) { XMLMarshaller xmlMarshaller = getXmlMarshaller().clone(); if(null == options) { return xmlMarshaller; } try { DataObject optionsDO = (DataObject) options; if(optionsDO.isSet(SDOConstants.ATTACHMENT_MARSHALLER_OPTION)) { xmlMarshaller.setAttachmentMarshaller((XMLAttachmentMarshaller)optionsDO.get(SDOConstants.ATTACHMENT_MARSHALLER_OPTION)); } xmlMarshaller.setMarshalListener(new SDOMarshalListener(xmlMarshaller, (SDOTypeHelper) aHelperContext.getTypeHelper())); return xmlMarshaller; } catch(ClassCastException ccException) { throw SDOException.optionsMustBeADataObject(ccException, SDOConstants.ORACLE_SDO_URL ,SDOConstants.XMLHELPER_LOAD_OPTIONS); } }
private XMLMarshaller getXmlMarshaller(Object options) { XMLMarshaller xmlMarshaller = getXmlMarshaller().clone(); if(null == options) { return xmlMarshaller; } try { DataObject optionsDO = (DataObject) options; if(optionsDO.isSet(SDOConstants.ATTACHMENT_MARSHALLER_OPTION)) { xmlMarshaller.setAttachmentMarshaller((XMLAttachmentMarshaller)optionsDO.get(SDOConstants.ATTACHMENT_MARSHALLER_OPTION)); } xmlMarshaller.setMarshalListener(new SDOMarshalListener(xmlMarshaller, (SDOTypeHelper) aHelperContext.getTypeHelper())); return xmlMarshaller; } catch(ClassCastException ccException) { throw SDOException.optionsMustBeADataObject(ccException, SDOConstants.ORACLE_SDO_URL ,SDOConstants.XMLHELPER_LOAD_OPTIONS); } }
marshaller.setAttachmentMarshaller(attachmentHandler); marshaller.marshal(response, body);
marshaller.setAttachmentMarshaller(attachmentHandler); marshaller.marshal(response, body);