/** * Recursive - Write method. * * @param aWriter java.io.Writer * @param aTabs tabs */ public void write(Writer aWriter, int aTabs) { try{ String attributeString = createAttributeString(); String ident = XMLHelper.makeIdent(aTabs); aWriter.write(ident+XMLHelper.entag(name +attributeString)); for (XMLNode child : nodes) child.write(aWriter, aTabs+1); if (content!=null) aWriter.write(XMLHelper.makeIdent(aTabs+1)+"<![CDATA["+content+"]]>\n"); aWriter.write(ident+XMLHelper.detag(name)); }catch(Throwable t){ log.error(t.getMessage(), t); } } }
/** * Recursive - Write method. * * @param aWriter OutputStreamWriter * @param aTabs position to start */ public void write(OutputStreamWriter aWriter, int aTabs) { try{ String attributeString = createAttributeString(); String ident = XMLHelper.makeIdent(aTabs); aWriter.write(ident+XMLHelper.entag(name +attributeString)); for (XMLNode child : nodes) child.write(aWriter, aTabs+1); if (content!=null) aWriter.write(XMLHelper.makeIdent(aTabs+1)+"<![CDATA["+content+"]]>\n"); aWriter.write(ident+XMLHelper.detag(name)); }catch(Throwable t){ log.error(t.getMessage(), t); } }
/** * Recursive - Write method. * * @param aWriter PrintStream writer. * @param aTabs position to start */ public void write(PrintStream aWriter, int aTabs) { String attributeString = createAttributeString(); String ident = XMLHelper.makeIdent(aTabs); aWriter.println(ident+XMLHelper.entag(name +attributeString)); for (XMLNode child : nodes) child.write(aWriter, aTabs+1); if (content!=null) aWriter.println(XMLHelper.makeIdent(aTabs+1)+"<![CDATA["+content+"]]>\n"); aWriter.println(ident+XMLHelper.detag(name)); }
/** * Recursive - Write method. * * @param aWriter PrintWriter * @param aTabs position to start */ public void write(PrintWriter aWriter, int aTabs) { String attributeString = createAttributeString(); String ident = XMLHelper.makeIdent(aTabs); aWriter.write(ident+XMLHelper.entag(name +attributeString)); for (XMLNode child : nodes) child.write(aWriter, aTabs+1); if (content!=null) aWriter.write(XMLHelper.makeIdent(aTabs+1)+"<![CDATA["+content+"]]>\n"); aWriter.write(ident+XMLHelper.detag(name)); }