diff --git a/src/fr/devinsy/xidyn/presenters/DomPresenterCore.java b/src/fr/devinsy/xidyn/presenters/DomPresenterCore.java index c0ac86a..43db729 100644 --- a/src/fr/devinsy/xidyn/presenters/DomPresenterCore.java +++ b/src/fr/devinsy/xidyn/presenters/DomPresenterCore.java @@ -19,7 +19,6 @@ package fr.devinsy.xidyn.presenters; import java.io.StringWriter; -import java.io.Writer; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -51,6 +50,40 @@ public class DomPresenterCore public static final char INDEX_SEPARATOR = '_'; public static final String NODISPLAY_CLASS = "xid:nodisplay"; + /** + * Dynamize a doc with data. + * + * @param result + * the result + * @param doc + * the doc + * @param data + * the data + * @throws Exception + * the exception + */ + public static void dynamize(final Appendable result, final Document doc, final TagDataListById data) throws Exception + { + process(result, doc, data); + } + + /** + * Dynamize a doc with data. + * + * @param result + * the result + * @param doc + * the doc + * @param data + * the data + * @throws Exception + * the exception + */ + public static void dynamize(final Appendable result, final Document doc, final TagDataManager data) throws Exception + { + dynamize(result, doc, data.getIdsDataById()); + } + /** * Dynamize a doc with data. * @@ -95,40 +128,6 @@ public class DomPresenterCore return result; } - /** - * Dynamize a doc with data. - * - * @param result - * the result - * @param doc - * the doc - * @param data - * the data - * @throws Exception - * the exception - */ - public static void dynamize(final Writer result, final Document doc, final TagDataListById data) throws Exception - { - process(result, doc, data); - } - - /** - * Dynamize a doc with data. - * - * @param result - * the result - * @param doc - * the doc - * @param data - * the data - * @throws Exception - * the exception - */ - public static void dynamize(final Writer result, final Document doc, final TagDataManager data) throws Exception - { - dynamize(result, doc, data.getIdsDataById()); - } - /** * Gets the class attribute value. * @@ -302,7 +301,7 @@ public class DomPresenterCore * @throws Exception * the exception */ - private static void process(final Writer result, final Node node, final TagDataListById data) throws Exception + private static void process(final Appendable result, final Node node, final TagDataListById data) throws Exception { process(result, node, data, ""); } @@ -321,7 +320,7 @@ public class DomPresenterCore * @throws Exception * the exception */ - private static void process(final Writer result, final Node node, final TagDataListById datas, final String suffix) throws Exception + private static void process(final Appendable result, final Node node, final TagDataListById datas, final String suffix) throws Exception { logger.debug("process - started"); String TRANSITIONAL_DTD = "xhtml1-transitional.dtd"; @@ -583,7 +582,7 @@ public class DomPresenterCore * @throws Exception * the exception */ - private static void processChildren(final Writer result, final Node node, final TagDataListById datas) throws Exception + private static void processChildren(final Appendable result, final Node node, final TagDataListById datas) throws Exception { processChildren(result, node, datas, ""); } @@ -602,7 +601,7 @@ public class DomPresenterCore * @throws Exception * the exception */ - private static void processChildren(final Writer result, final Node node, final TagDataListById datas, final String suffix) throws Exception + private static void processChildren(final Appendable result, final Node node, final TagDataListById datas, final String suffix) throws Exception { // Get the iteration strategy. SimpleTagData.IterationStrategy strategy; @@ -742,7 +741,7 @@ public class DomPresenterCore * @throws Exception * the exception */ - private static void processElementBasically(final Writer result, final Node node, final TagDataListById datas) throws Exception + private static void processElementBasically(final Appendable result, final Node node, final TagDataListById datas) throws Exception { processElementBasically(result, node, datas, ""); } @@ -761,7 +760,7 @@ public class DomPresenterCore * @throws Exception * the exception */ - private static void processElementBasically(final Writer result, final Node node, final TagDataListById datas, final String suffix) throws Exception + private static void processElementBasically(final Appendable result, final Node node, final TagDataListById datas, final String suffix) throws Exception { logger.debug("processElementBasically - started [{}]", node.getNodeName()); @@ -810,8 +809,7 @@ public class DomPresenterCore * @throws Exception * the exception */ - private static void processElementWithId(final Writer result, final Node node, final NamedNodeMap attrs, final Node idAttr, final TagDataListById datas) throws Exception - + private static void processElementWithId(final Appendable result, final Node node, final NamedNodeMap attrs, final Node idAttr, final TagDataListById datas) throws Exception { processElementWithId(result, node, attrs, idAttr, datas, ""); } @@ -835,7 +833,7 @@ public class DomPresenterCore * @throws Exception * the exception */ - private static void processElementWithId(final Writer result, final Node node, final NamedNodeMap attrs, final Node idAttr, final TagDataListById datas, final String suffix) throws Exception + private static void processElementWithId(final Appendable result, final Node node, final NamedNodeMap attrs, final Node idAttr, final TagDataListById datas, final String suffix) throws Exception { String tag = node.getNodeName();