public boolean save(File file, String options) { PrintWriter writer = PApplet.createWriter(file); boolean result = write(writer); writer.flush(); writer.close(); return result; }
/** * ** Encodes the specified DBRecordKyes into XML and writes it to ** a specified PrintWriter * ** @param out The PrintWriter ** @param dbrk The list of DBRecordKeys */ public static void printXML(PrintWriter out, DBRecordKey... dbrk) { if (out != null) { out.write("<" + DBFactory.TAG_RecordKeys + ">\n"); for (int i = 0; i < dbrk.length; i++) { dbrk[i].printXML(out, 4); } out.write("</" + DBFactory.TAG_RecordKeys + ">\n"); out.flush(); } }
/** * ** Encodes this DBRecordKey into XML and writes it to a specified PrintWriter ** @param out The * PrintWriter ** @param indent The number of spaces to indent ** @param sequence Optional * sequence value ** @param soapXML True for SOAP XML */ public void printXML(PrintWriter out, int indent, int sequence, boolean soapXML) { if (out != null) { out.write(this.toXML(null, indent, sequence, soapXML).toString()); out.flush(); } }
// Sends this object and its kids to a Writer with an indent of 2 spaces, // including the declaration at the top so that the output will be valid XML. public boolean write(PrintWriter output) { output.print(format(2)); output.flush(); return true; }