diff --git a/src/fr/devinsy/util/xml/XMLWriter.java b/src/fr/devinsy/util/xml/XMLWriter.java index 550d72a..d64016e 100644 --- a/src/fr/devinsy/util/xml/XMLWriter.java +++ b/src/fr/devinsy/util/xml/XMLWriter.java @@ -43,7 +43,7 @@ public class XMLWriter protected PrintWriter out; /** - * + * Default constructor (useful for extend this class). */ protected XMLWriter() { @@ -51,8 +51,11 @@ public class XMLWriter } /** + * Initialize a XML Writer to a file. * * @param file + * Where write the XML data. + * * @throws FileNotFoundException * @throws UnsupportedEncodingException */ @@ -62,8 +65,11 @@ public class XMLWriter } /** + * Initialize a XML Writer to a OutputStream. * * @param target + * Where write the XML data. + * * @throws UnsupportedEncodingException */ public XMLWriter(final OutputStream target) throws UnsupportedEncodingException @@ -72,8 +78,11 @@ public class XMLWriter } /** + * Initialize a XML Writer to a Writer. * * @param target + * Where write the XML data. + * * @throws UnsupportedEncodingException */ public XMLWriter(final Writer target) throws UnsupportedEncodingException @@ -82,7 +91,7 @@ public class XMLWriter } /** - * + * This method closes the target stream. */ public void close() throws IOException { @@ -94,7 +103,7 @@ public class XMLWriter } /** - * + * This method flushes the target stream. */ public void flush() throws IOException { @@ -105,8 +114,10 @@ public class XMLWriter } /** + * This method writes a XML comment. * * @param comment + * The comment to write. */ public void writeComment(final String comment) { @@ -119,7 +130,7 @@ public class XMLWriter } /** - * + * This method writes a XML tag with no content. */ public void writeEmptyTag(final String label, final String... attributes) { @@ -130,7 +141,7 @@ public class XMLWriter } /** - * + * This method writes a XML ender tag. */ public void writeEndTag(final String label) { @@ -140,7 +151,7 @@ public class XMLWriter } /** - * + * This method writes a XML start tag. */ public void writeStartTag(final String label, final String... attributes) { @@ -151,33 +162,43 @@ public class XMLWriter } /** + * This method write a XML tag with attributes and boolean content data. * + * @param label + * @param content + * @param attributes */ public void writeTag(final String label, final boolean content, final String... attributes) { - writeStartTag(label, attributes); writeTagContent(String.valueOf(content)); writeEndTag(label); } /** + * This method write a XML tag with attributes and long content data. * + * @param label + * @param content + * @param attributes */ public void writeTag(final String label, final long content, final String... attributes) { - writeStartTag(label, attributes); writeTagContent(String.valueOf(content)); writeEndTag(label); } /** + * This method write a XML tag with attributes and content data. Content + * data are converted in XML format. * + * @param label + * @param content + * @param attributes */ public void writeTag(final String label, final String content, final String... attributes) { - if (content == null) { writeEmptyTag(label, attributes); @@ -191,7 +212,9 @@ public class XMLWriter } /** + * This method writes attributes of a tag. * + * @param attributes */ private void writeTagAttributes(final String... attributes) { @@ -210,7 +233,10 @@ public class XMLWriter } /** + * This method writes content using XML escape. * + * @param content + * data to write in XML format. */ private void writeTagContent(final String content) { @@ -244,7 +270,9 @@ public class XMLWriter } /** + * This method writes a XML header with attributes. * + * @param attributes */ public void writeXMLHeader(final String... attributes) {