public XmlOutput createWriter(Writer w) { return createWriter(w, getEncoding()); }
public void marshal(Marshaller _m, T t, OutputStream output, NamespaceContext nsContext) throws JAXBException { MarshallerImpl m = (MarshallerImpl)_m; Runnable pia = null; if(nsContext!=null) pia = new StAXPostInitAction(nsContext,m.serializer); m.write(tagName,bi,t,m.createWriter(output),pia); }
/** * Marshals to {@link OutputStream} with the given in-scope namespaces * taken into account. * * @since 2.1.5 */ public void marshal(Object obj, OutputStream out, NamespaceContext inscopeNamespace) throws JAXBException { write(obj, createWriter(out), new StAXPostInitAction(inscopeNamespace,serializer)); }
return createWriter(sr.getWriter()); else if (sr.getOutputStream() != null) return createWriter(sr.getOutputStream()); else if (sr.getSystemId() != null) { String fileURL = sr.getSystemId(); assert toBeClosed==null; toBeClosed = fos; return createWriter(fos); } catch (IOException e) { throw new MarshalException(e);
public XmlOutput createWriter( OutputStream os, String encoding ) throws JAXBException { // UTF8XmlOutput does buffering on its own, and // otherwise createWriter(Writer) inserts a buffering, // so no point in doing a buffering here. if(encoding.equals("UTF-8")) { Encoded[] table = context.getUTF8NameTable(); final UTF8XmlOutput out; CharacterEscapeHandler ceh = createEscapeHandler(encoding); if(isFormattedOutput()) out = new IndentingUTF8XmlOutput(os, indent, table, ceh); else { if(c14nSupport) out = new C14nXmlOutput(os, table, context.c14nSupport, ceh); else out = new UTF8XmlOutput(os, table, ceh); } if(header!=null) out.setHeader(header); return out; } try { return createWriter( new OutputStreamWriter(os,getJavaEncoding(encoding)), encoding ); } catch( UnsupportedEncodingException e ) { throw new MarshalException( Messages.UNSUPPORTED_ENCODING.format(encoding), e ); } }
public XmlOutput createWriter(Writer w) { return createWriter(w, getEncoding()); }
public void marshal(Marshaller _m, T t, OutputStream output, NamespaceContext nsContext) throws JAXBException { MarshallerImpl m = (MarshallerImpl)_m; Runnable pia = null; if(nsContext!=null) pia = new StAXPostInitAction(nsContext,m.serializer); m.write(tagName,bi,t,m.createWriter(output),pia); }
/** * Marshals to {@link OutputStream} with the given in-scope namespaces * taken into account. * * @since 2.1.5 */ public void marshal(Object obj, OutputStream out, NamespaceContext inscopeNamespace) throws JAXBException { write(obj, createWriter(out), new StAXPostInitAction(inscopeNamespace,serializer)); }
public XmlOutput createWriter( OutputStream os, String encoding ) throws JAXBException { // UTF8XmlOutput does buffering on its own, and // otherwise createWriter(Writer) inserts a buffering, // so no point in doing a buffering here. if(encoding.equals("UTF-8")) { Encoded[] table = context.getUTF8NameTable(); final UTF8XmlOutput out; CharacterEscapeHandler ceh = createEscapeHandler(encoding); if(isFormattedOutput()) out = new IndentingUTF8XmlOutput(os, indent, table, ceh); else { if(c14nSupport) out = new C14nXmlOutput(os, table, context.c14nSupport, ceh); else out = new UTF8XmlOutput(os, table, ceh); } if(header!=null) out.setHeader(header); return out; } try { return createWriter( new OutputStreamWriter(os,getJavaEncoding(encoding)), encoding ); } catch( UnsupportedEncodingException e ) { throw new MarshalException( Messages.UNSUPPORTED_ENCODING.format(encoding), e ); } }
return createWriter(sr.getWriter()); else if (sr.getOutputStream() != null) return createWriter(sr.getOutputStream()); else if (sr.getSystemId() != null) { String fileURL = sr.getSystemId(); assert toBeClosed==null; toBeClosed = fos; return createWriter(fos); } catch (IOException e) { throw new MarshalException(e);
public XmlOutput createWriter(Writer w) { return createWriter(w, getEncoding()); }
public XmlOutput createWriter(Writer w) { return createWriter(w, getEncoding()); }
/** * Marshals to {@link OutputStream} with the given in-scope namespaces * taken into account. * * @since 2.1.5 */ public void marshal(Object obj, OutputStream out, NamespaceContext inscopeNamespace) throws JAXBException { write(obj, createWriter(out), new StAXPostInitAction(inscopeNamespace,serializer)); }
public void marshal(Marshaller _m, T t, OutputStream output, NamespaceContext nsContext) throws JAXBException { MarshallerImpl m = (MarshallerImpl)_m; Runnable pia = null; if(nsContext!=null) pia = new StAXPostInitAction(nsContext,m.serializer); m.write(tagName,bi,t,m.createWriter(output),pia); }
/** * Marshals to {@link OutputStream} with the given in-scope namespaces * taken into account. * * @since 2.1.5 */ public void marshal(Object obj, OutputStream out, NamespaceContext inscopeNamespace) throws JAXBException { write(obj, createWriter(out), new StAXPostInitAction(inscopeNamespace,serializer)); }
public void marshal(Marshaller _m, T t, OutputStream output, NamespaceContext nsContext) throws JAXBException { MarshallerImpl m = (MarshallerImpl)_m; Runnable pia = null; if(nsContext!=null) pia = new StAXPostInitAction(nsContext,m.serializer); m.write(tagName,bi,t,m.createWriter(output),pia); }
public XmlOutput createWriter( OutputStream os, String encoding ) throws JAXBException { // UTF8XmlOutput does buffering on its own, and // otherwise createWriter(Writer) inserts a buffering, // so no point in doing a buffering here. if(encoding.equals("UTF-8")) { Encoded[] table = context.getUTF8NameTable(); final UTF8XmlOutput out; if(isFormattedOutput()) out = new IndentingUTF8XmlOutput(os, indent, table, escapeHandler); else { if(c14nSupport) out = new C14nXmlOutput(os, table, context.c14nSupport, escapeHandler); else out = new UTF8XmlOutput(os, table, escapeHandler); } if(header!=null) out.setHeader(header); return out; } try { return createWriter( new OutputStreamWriter(os,getJavaEncoding(encoding)), encoding ); } catch( UnsupportedEncodingException e ) { throw new MarshalException( Messages.UNSUPPORTED_ENCODING.format(encoding), e ); } }
public XmlOutput createWriter( OutputStream os, String encoding ) throws JAXBException { // UTF8XmlOutput does buffering on its own, and // otherwise createWriter(Writer) inserts a buffering, // so no point in doing a buffering here. if(encoding.equals("UTF-8")) { Encoded[] table = context.getUTF8NameTable(); final UTF8XmlOutput out; CharacterEscapeHandler ceh = createEscapeHandler(encoding); if(isFormattedOutput()) out = new IndentingUTF8XmlOutput(os, indent, table, ceh); else { if(c14nSupport) out = new C14nXmlOutput(os, table, context.c14nSupport, ceh); else out = new UTF8XmlOutput(os, table, ceh); } if(header!=null) out.setHeader(header); return out; } try { return createWriter( new OutputStreamWriter(os,getJavaEncoding(encoding)), encoding ); } catch( UnsupportedEncodingException e ) { throw new MarshalException( Messages.UNSUPPORTED_ENCODING.format(encoding), e ); } }
return createWriter(sr.getWriter()); else if (sr.getOutputStream() != null) return createWriter(sr.getOutputStream()); else if (sr.getSystemId() != null) { String fileURL = sr.getSystemId(); assert toBeClosed==null; toBeClosed = fos; return createWriter(fos); } catch (IOException e) { throw new MarshalException(e);
return createWriter(sr.getWriter()); else if (sr.getOutputStream() != null) return createWriter(sr.getOutputStream()); else if (sr.getSystemId() != null) { String fileURL = sr.getSystemId(); assert toBeClosed==null; toBeClosed = fos; return createWriter(fos); } catch (IOException e) { throw new MarshalException(e);