public static Object unmarshalWithBridge(QName qname, Class<?> cls, Annotation anns[], Set<Type> ctxClasses, Object source, AttachmentUnmarshaller am) { try { com.github.cxfplus.jaxbplus.JAXBUtils.BridgeWrapper bridge = com.github.cxfplus.jaxbplus.JAXBUtils.createBridge(ctxClasses, qname, cls, anns); if (source instanceof XMLStreamReader) { //DOMUtils.writeXml(StaxUtils.read((XMLStreamReader)source), System.out); return bridge.unmarshal((XMLStreamReader)source, am); } else if (source instanceof InputStream) { return bridge.unmarshal((InputStream)source); } else if (source instanceof Node) { return bridge.unmarshal((Node)source, am); } else { throw new Fault(new Message("UNKNOWN_SOURCE", LOG, source.getClass().getName())); } } catch (Exception ex) { if (ex instanceof javax.xml.bind.MarshalException) { javax.xml.bind.MarshalException marshalEx = (javax.xml.bind.MarshalException)ex; Message faultMessage = new Message("MARSHAL_ERROR", LOG, marshalEx.getLinkedException() .getMessage()); throw new Fault(faultMessage, ex); } else { throw new Fault(new Message("MARSHAL_ERROR", LOG, ex.getMessage()), ex); } } }
/** * @since 2.0.3 */ public final @NotNull T unmarshal(@NotNull XMLStreamReader in, @Nullable AttachmentUnmarshaller au) throws JAXBException { Unmarshaller u = context.unmarshallerPool.take(); u.setAttachmentUnmarshaller(au); return exit(unmarshal(u,in),u); }
/** * @since 2.0.3 */ public final @NotNull T unmarshal(@NotNull Source in, @Nullable AttachmentUnmarshaller au) throws JAXBException { Unmarshaller u = context.unmarshallerPool.take(); u.setAttachmentUnmarshaller(au); return exit(unmarshal(u,in),u); }
/** * @since 2.0.3 */ public final @NotNull T unmarshal(@NotNull Node n, @Nullable AttachmentUnmarshaller au) throws JAXBException { Unmarshaller u = context.unmarshallerPool.take(); u.setAttachmentUnmarshaller(au); return exit(unmarshal(u,n),u); }
@Override public final T unmarshal(Node n, AttachmentUnmarshaller au) throws JAXBException { //EndpointArgumentsBuilder.RpcLit.readRequest throw new UnsupportedOperationException(); // return bridge.unmarshal(n, au); }
@Override public final T unmarshal(Source in, AttachmentUnmarshaller au) throws JAXBException { //EndpointArgumentsBuilder.RpcLit.readRequest throw new UnsupportedOperationException(); // return bridge.unmarshal(in, au); }
@Override public final T unmarshal(XMLStreamReader in, AttachmentUnmarshaller au) throws JAXBException { //EndpointArgumentsBuilder.RpcLit.readRequest throw new UnsupportedOperationException(); // return bridge.unmarshal(in, au); }
@Override public T unmarshal(XMLStreamReader in, AttachmentUnmarshaller au) throws JAXBException { return delegate.unmarshal(in, au); }
@Override public T unmarshal(Source in, AttachmentUnmarshaller au) throws JAXBException { return delegate.unmarshal(in, au); }
@Override public T unmarshal(Node n, AttachmentUnmarshaller au) throws JAXBException { return delegate.unmarshal(n, au); }
@Override public final T unmarshal(Node n, AttachmentUnmarshaller au) throws JAXBException { return bridge.unmarshal(n, au); }
@Override public final T unmarshal(Source in, AttachmentUnmarshaller au) throws JAXBException { return bridge.unmarshal(in, au); }
@Override public final T unmarshal(XMLStreamReader in, AttachmentUnmarshaller au) throws JAXBException { return bridge.unmarshal(in, au); }
public void setAttachmentUnmarshaller(AttachmentUnmarshaller u) { unmarshaller.setAttachmentUnmarshaller(u); }
public AttachmentUnmarshaller getAttachmentUnmarshaller() { return unmarshaller.getAttachmentUnmarshaller(); }
public MTOMDecorator(UnmarshallerImpl parent,XmlVisitor next, AttachmentUnmarshaller au) { this.parent = parent; this.next = next; this.au = au; }
@Override public AttachmentUnmarshaller getAttachmentUnmarshaller() { return attachmentUnmarshaller; }
@Override public void setAttachmentUnmarshaller(AttachmentUnmarshaller au) { this.attachmentUnmarshaller = au; }
public DataHandler unmarshal(String cid) { AttachmentUnmarshaller au = UnmarshallingContext.getInstance().parent.getAttachmentUnmarshaller(); // TODO: error check return au.getAttachmentAsDataHandler(cid); }
public void setAttachmentUnmarshaller(AttachmentUnmarshaller au) { throw new UnsupportedOperationException(); }
public AttachmentUnmarshaller getAttachmentUnmarshaller() { throw new UnsupportedOperationException(); }