/** * Constructs a new serializer that writes to the specified output * stream using the specified output format. If <tt>format</tt> * is null, will use a default output format. * * @param output The output stream to use * @param format The output format to use, null for the default */ public XHTMLSerializer( OutputStream output, OutputFormat format ) { super( true, format != null ? format : new OutputFormat( Method.XHTML, null, false ) ); setOutputByteStream( output ); }
/** * Constructs a new serializer that writes to the specified writer * using the specified output format. If <tt>format</tt> is null, * will use a default output format. * * @param writer The writer to use * @param format The output format to use, null for the default */ public XHTMLSerializer( Writer writer, OutputFormat format ) { super( true, format != null ? format : new OutputFormat( Method.XHTML, null, false ) ); setOutputCharStream( writer ); }
private Serializer getSerializer( OutputFormat format ) { if ( _method.equals( Method.XML ) ) { return new XMLSerializer( format ); } else if ( _method.equals( Method.HTML ) ) { return new HTMLSerializer( format ); } else if ( _method.equals( Method.XHTML ) ) { return new XHTMLSerializer( format ); } else if ( _method.equals( Method.TEXT ) ) { return new TextSerializer(); } else { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN, "MethodNotSupported", new Object[]{_method}); throw new IllegalStateException(msg); } }
private Serializer getSerializer( OutputFormat format ) { if ( _method.equals( Method.XML ) ) { return new XMLSerializer( format ); } else if ( _method.equals( Method.HTML ) ) { return new HTMLSerializer( format ); } else if ( _method.equals( Method.XHTML ) ) { return new XHTMLSerializer( format ); } else if ( _method.equals( Method.TEXT ) ) { return new TextSerializer(); } else { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN, "MethodNotSupported", new Object[]{_method}); throw new IllegalStateException(msg); } }
/** * Constructs a new serializer that writes to the specified output * stream using the specified output format. If <tt>format</tt> * is null, will use a default output format. * * @param output The output stream to use * @param format The output format to use, null for the default */ public XHTMLSerializer( OutputStream output, OutputFormat format ) { super( true, format != null ? format : new OutputFormat( Method.XHTML, null, false ) ); setOutputByteStream( output ); }
/** * Constructs a new serializer that writes to the specified writer * using the specified output format. If <tt>format</tt> is null, * will use a default output format. * * @param writer The writer to use * @param format The output format to use, null for the default */ public XHTMLSerializer( Writer writer, OutputFormat format ) { super( true, format != null ? format : new OutputFormat( Method.XHTML, null, false ) ); setOutputCharStream( writer ); }