public static void write( Writer writer, Xpp3Dom dom ) { write( new PrettyPrintXMLWriter( writer ), dom ); }
/** * Copy constructor. */ public Xpp3Dom( Xpp3Dom src ) { this( src, src.getName() ); }
public static Object cloneConfiguration( Object configuration ) { if ( configuration == null ) { return null; } return new Xpp3Dom( (Xpp3Dom) configuration ); }
public static Xpp3Dom build( Reader reader ) throws XmlPullParserException, IOException { return build( reader, DEFAULT_TRIM ); }
public void writeToSerializer( String namespace, XmlSerializer serializer ) throws IOException { // TODO: WARNING! Later versions of plexus-utils psit out an <?xml ?> header due to thinking this is a new // document - not the desired behaviour! SerializerXMLWriter xmlWriter = new SerializerXMLWriter( namespace, serializer ); Xpp3DomWriter.write( xmlWriter, this ); if ( xmlWriter.getExceptions().size() > 0 ) { throw (IOException) xmlWriter.getExceptions().get( 0 ); } }
public static void write( XMLWriter xmlWriter, Xpp3Dom dom ) { write( xmlWriter, dom, true ); }
/** * Create a new Reader with XML encoding detection rules. * * @param file not null file. * @return an XML reader instance for the input file. * @throws IOException if any. * @see XmlStreamReader */ public static XmlStreamReader newXmlReader( File file ) throws IOException { return new XmlStreamReader( file ); }
/** {@inheritDoc} */ public void writeText( String text ) { writeText( text, true ); }
/** * Convenience method to write one <code>CRLF</code>. * * @param writer not null writer */ public static void writeLineBreak( XMLWriter writer ) { writeLineBreak( writer, 1 ); }
/** * Convenience method to write XML comment line break. Its size is <code>80</code>. * * @param writer not null * @see #DEFAULT_COLUMN_LINE * @see #writeCommentLineBreak(XMLWriter, int) */ public static void writeCommentLineBreak( XMLWriter writer ) { writeCommentLineBreak( writer, DEFAULT_COLUMN_LINE ); }
/** * Create a new Writer with XML encoding detection rules. * * @param out not null output stream. * @return an XML writer instance for the output stream. * @throws IOException if any. * @see XmlStreamWriter */ public static XmlStreamWriter newXmlWriter( OutputStream out ) throws IOException { return new XmlStreamWriter( out ); }
/** * Convenience method to write XML comments between two comments line break. The XML comment block is not indented. * * @param writer not null * @param comment * @see #DEFAULT_INDENTATION_SIZE * @see #writeCommentText(XMLWriter, String, int, int) */ public static void writeCommentText( XMLWriter writer, String comment ) { writeCommentText( writer, comment, 0, DEFAULT_INDENTATION_SIZE ); }
public static Xpp3Dom build( XmlPullParser parser ) throws XmlPullParserException, IOException { return build( parser, DEFAULT_TRIM ); }
public static void write( PrintWriter writer, Xpp3Dom dom ) { write( new PrettyPrintXMLWriter( writer ), dom ); }
public void writeToSerializer( String namespace, XmlSerializer serializer, Xpp3Dom dom ) throws IOException { // TODO: WARNING! Later versions of plexus-utils psit out an <?xml ?> header due to thinking this is a new // document - not the desired behaviour! SerializerXMLWriter xmlWriter = new SerializerXMLWriter( namespace, serializer ); Xpp3DomWriter.write( xmlWriter, dom ); if ( xmlWriter.getExceptions().size() > 0 ) { throw (IOException) xmlWriter.getExceptions().get( 0 ); } }
/** * Create a new Reader with XML encoding detection rules. * * @param url not null url. * @return an XML reader instance for the input url. * @throws IOException if any. * @see XmlStreamReader */ public static XmlStreamReader newXmlReader( URL url ) throws IOException { return new XmlStreamReader( url ); }
/** {@inheritDoc} */ public void writeMarkup( String text ) { writeText( text, false ); }
public String toString() { // TODO: WARNING! Later versions of plexus-utils psit out an <?xml ?> header due to thinking this is a new // document - not the desired behaviour! StringWriter writer = new StringWriter(); XMLWriter xmlWriter = new PrettyPrintXMLWriter( writer, "UTF-8", null ); Xpp3DomWriter.write( xmlWriter, this ); return writer.toString(); }
public String toUnescapedString() { // TODO: WARNING! Later versions of plexus-utils psit out an <?xml ?> header due to thinking this is a new // document - not the desired behaviour! StringWriter writer = new StringWriter(); XMLWriter xmlWriter = new PrettyPrintXMLWriter( writer, "UTF-8", null ); Xpp3DomWriter.write( xmlWriter, this, false ); return writer.toString(); }