@Override public void setAttachmentMarshaller(AttachmentMarshaller marshaller) { jaxbMarshaller.setAttachmentMarshaller(marshaller); }
/** * @since 2.0.2 */ public void marshal(T object,OutputStream output, NamespaceContext nsContext, AttachmentMarshaller am) throws JAXBException { Marshaller m = context.marshallerPool.take(); m.setAttachmentMarshaller(am); marshal(m,object,output,nsContext); m.setAttachmentMarshaller(null); context.marshallerPool.recycle(m); }
/** * @since 2.0.2 */ public final void marshal(T object, ContentHandler contentHandler, AttachmentMarshaller am) throws JAXBException { Marshaller m = context.marshallerPool.take(); m.setAttachmentMarshaller(am); marshal(m,object,contentHandler); m.setAttachmentMarshaller(null); context.marshallerPool.recycle(m); } public final void marshal(@NotNull BridgeContext context,T object, ContentHandler contentHandler) throws JAXBException {
public final void marshal(T object,XMLStreamWriter output, AttachmentMarshaller am) throws JAXBException { Marshaller m = context.marshallerPool.take(); m.setAttachmentMarshaller(am); marshal(m,object,output); m.setAttachmentMarshaller(null); context.marshallerPool.recycle(m); }
@Override public void marshal(Object graph, Result result, @Nullable MimeContainer mimeContainer) throws XmlMappingException { try { Marshaller marshaller = createMarshaller(); if (this.mtomEnabled && mimeContainer != null) { marshaller.setAttachmentMarshaller(new Jaxb2AttachmentMarshaller(mimeContainer)); } if (StaxUtils.isStaxResult(result)) { marshalStaxResult(marshaller, graph, result); } else { marshaller.marshal(graph, result); } } catch (JAXBException ex) { throw convertJaxbException(ex); } }
public void setAttachmentMarshaller(AttachmentMarshaller attachmentMarshaller) { marshaller.setAttachmentMarshaller(attachmentMarshaller); }
public void setAttachmentMarshaller(AttachmentMarshaller marshaller) { jaxbMarshaller.setAttachmentMarshaller(marshaller); }
/** * @since 2.0.2 */ public final void marshal(T object, ContentHandler contentHandler, AttachmentMarshaller am) throws JAXBException { Marshaller m = context.marshallerPool.take(); m.setAttachmentMarshaller(am); marshal(m,object,contentHandler); m.setAttachmentMarshaller(null); context.marshallerPool.recycle(m); } public final void marshal(@NotNull BridgeContext context,T object, ContentHandler contentHandler) throws JAXBException {
public final void marshal(T object,XMLStreamWriter output, AttachmentMarshaller am) throws JAXBException { Marshaller m = context.marshallerPool.take(); m.setAttachmentMarshaller(am); marshal(m,object,output); m.setAttachmentMarshaller(null); context.marshallerPool.recycle(m); }
/** * @since 2.0.2 */ public void marshal(T object,OutputStream output, NamespaceContext nsContext, AttachmentMarshaller am) throws JAXBException { Marshaller m = context.marshallerPool.take(); m.setAttachmentMarshaller(am); marshal(m,object,output,nsContext); m.setAttachmentMarshaller(null); context.marshallerPool.recycle(m); }
public void writeTo(Object t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, final MultipartRelatedOutput xopPackage) throws IOException { try { LogMessages.LOGGER.debugf("Provider : %s, Method : writeTo", getClass().getName()); Map<String, String> mediaTypeParameters = new LinkedHashMap<String, String>(); mediaTypeParameters.put("charset", StandardCharsets.UTF_8.name()); mediaTypeParameters.put("type", "text/xml"); MediaType xopRootMediaType = new MediaType("application", "xop+xml", mediaTypeParameters); Marshaller marshaller = getMarshaller(type, annotations, xopRootMediaType); marshaller.setAttachmentMarshaller(new XopAttachmentMarshaller( xopPackage)); ByteArrayOutputStream xml = new ByteArrayOutputStream(); marshaller.marshal(t, xml); OutputPart outputPart = xopPackage.addPart(xml.toByteArray(), xopRootMediaType, ContentIDUtils.generateContentID(), null); List<OutputPart> outputParts = xopPackage.getParts(); outputParts.remove(outputPart); outputParts.add(0, outputPart); } catch (JAXBException e) { Response response = Response.serverError().build(); throw new WebApplicationException(e, response); } }
public void releaseJAXBMarshaller(JAXBContext context, Marshaller marshaller) { if (marshaller != null) { marshaller.setAttachmentMarshaller(null); mpool.put(context, marshaller); // No point unsetting marshaller's JAXB_FRAGMENT property, since we'll just reset it when // doing the next get. } }
/** * @since 2.0.2 */ public void marshal(T object,OutputStream output, NamespaceContext nsContext, AttachmentMarshaller am) throws JAXBException { Marshaller m = context.marshallerPool.take(); m.setAttachmentMarshaller(am); marshal(m,object,output,nsContext); m.setAttachmentMarshaller(null); context.marshallerPool.recycle(m); }
/** * @since 2.0.2 */ public void marshal(T object,OutputStream output, NamespaceContext nsContext, AttachmentMarshaller am) throws JAXBException { Marshaller m = context.marshallerPool.take(); m.setAttachmentMarshaller(am); marshal(m,object,output,nsContext); m.setAttachmentMarshaller(null); context.marshallerPool.recycle(m); }
public final void marshal(T object,XMLStreamWriter output, AttachmentMarshaller am) throws JAXBException { Marshaller m = context.marshallerPool.take(); m.setAttachmentMarshaller(am); marshal(m,object,output); m.setAttachmentMarshaller(null); context.marshallerPool.recycle(m); }
/** * @since 2.0.2 */ public final void marshal(T object, ContentHandler contentHandler, AttachmentMarshaller am) throws JAXBException { Marshaller m = context.marshallerPool.take(); m.setAttachmentMarshaller(am); marshal(m,object,contentHandler); m.setAttachmentMarshaller(null); context.marshallerPool.recycle(m); } public final void marshal(@NotNull BridgeContext context,T object, ContentHandler contentHandler) throws JAXBException {
/** * @since 2.0.2 */ public final void marshal(T object, ContentHandler contentHandler, AttachmentMarshaller am) throws JAXBException { Marshaller m = context.marshallerPool.take(); m.setAttachmentMarshaller(am); marshal(m,object,contentHandler); m.setAttachmentMarshaller(null); context.marshallerPool.recycle(m); } public final void marshal(@NotNull BridgeContext context,T object, ContentHandler contentHandler) throws JAXBException {
public final void marshal(T object,XMLStreamWriter output, AttachmentMarshaller am) throws JAXBException { Marshaller m = context.marshallerPool.take(); m.setAttachmentMarshaller(am); marshal(m,object,output); m.setAttachmentMarshaller(null); context.marshallerPool.recycle(m); }
protected void addAttachmentMarshaller(Marshaller ms) { Collection<Attachment> attachments = getAttachments(true); if (attachments != null) { Object value = getContext().getContextualProperty(Message.MTOM_THRESHOLD); Integer threshold = value != null ? Integer.valueOf(value.toString()) : Integer.valueOf(0); ms.setAttachmentMarshaller(new JAXBAttachmentMarshaller( attachments, threshold)); } }
/** * Delegates to the wrapped marshaller. The initial state will be saved * if it was not already done, for future restoration by {@link #reset(Pooled)}. */ @Override public void setAttachmentMarshaller(final AttachmentMarshaller am) { if (!isPropertySaved(AttachmentMarshaller.class)) { saveProperty(AttachmentMarshaller.class, marshaller.getAttachmentMarshaller()); } marshaller.setAttachmentMarshaller(am); }