From bc9b2b5dd4c45bd82e185883cc838c019fbab09b Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sun, 23 Jun 2013 01:51:00 +0200 Subject: [PATCH] Rename doXid method as dynamize. --- demo/XidDemo.java | 18 +++++++++--------- src/fr/devinsy/xidyn/DomPresenter.java | 22 +++++++++++----------- src/fr/devinsy/xidyn/FilePresenter.java | 22 +++++++++++----------- src/fr/devinsy/xidyn/Presenter.java | 2 +- src/fr/devinsy/xidyn/StringPresenter.java | 16 ++++++++-------- test/XidTest.java | 18 +++++++++--------- 6 files changed, 49 insertions(+), 49 deletions(-) diff --git a/demo/XidDemo.java b/demo/XidDemo.java index 08b7c17..ae54d63 100644 --- a/demo/XidDemo.java +++ b/demo/XidDemo.java @@ -45,7 +45,7 @@ class XidDemo StringBuffer htmlTarget; try { - htmlTarget = StringPresenter.doXid(htmlSource, datas); + htmlTarget = StringPresenter.dynamize(htmlSource, datas); } catch (Exception exception) { @@ -75,7 +75,7 @@ class XidDemo StringBuffer htmlTarget; try { - htmlTarget = StringPresenter.doXid(htmlSource, datas); + htmlTarget = StringPresenter.dynamize(htmlSource, datas); } catch (Exception exception) { @@ -111,7 +111,7 @@ class XidDemo StringBuffer htmlTarget; try { - htmlTarget = StringPresenter.doXid(htmlSource, datas); + htmlTarget = StringPresenter.dynamize(htmlSource, datas); } catch (Exception exception) { @@ -156,7 +156,7 @@ class XidDemo StringBuffer htmlTarget; try { - htmlTarget = StringPresenter.doXid(htmlSource, datas); + htmlTarget = StringPresenter.dynamize(htmlSource, datas); } catch (Exception exception) { @@ -225,7 +225,7 @@ class XidDemo StringBuffer html; try { - html = StringPresenter.doXid(htmlSource, datas); + html = StringPresenter.dynamize(htmlSource, datas); } catch (Exception exception) { @@ -240,7 +240,7 @@ class XidDemo System.out.println("ONLY_FIRST_TWO_ROWS:"); try { - html = StringPresenter.doXid(htmlSource, datas); + html = StringPresenter.dynamize(htmlSource, datas); } catch (Exception exception) { @@ -255,7 +255,7 @@ class XidDemo System.out.println("ONLY_ROWS_WITH_ID:"); try { - html = StringPresenter.doXid(htmlSource, datas); + html = StringPresenter.dynamize(htmlSource, datas); } catch (Exception exception) { @@ -270,7 +270,7 @@ class XidDemo System.out.println("ONLY_ROWS_WITHOUT_ID:"); try { - html = StringPresenter.doXid(htmlSource, datas); + html = StringPresenter.dynamize(htmlSource, datas); } catch (Exception exception) { @@ -285,7 +285,7 @@ class XidDemo System.out.println("ALL_ROWS:"); try { - html = StringPresenter.doXid(htmlSource, datas); + html = StringPresenter.dynamize(htmlSource, datas); } catch (Exception exception) { diff --git a/src/fr/devinsy/xidyn/DomPresenter.java b/src/fr/devinsy/xidyn/DomPresenter.java index 14d42d8..81697b3 100644 --- a/src/fr/devinsy/xidyn/DomPresenter.java +++ b/src/fr/devinsy/xidyn/DomPresenter.java @@ -46,15 +46,7 @@ public class DomPresenter extends Presenter /** * */ - public StringBuffer doXid(final Data datas) throws Exception - { - return (doXid(datas.getIdsDataById())); - } - - /** - * - */ - public StringBuffer doXid(final IdsDataById datas) throws Exception + public StringBuffer dynamize(final IdsDataById datas) throws Exception { StringBuffer result; @@ -69,7 +61,7 @@ public class DomPresenter extends Presenter { // Build the web page. StringWriter htmlCode = new StringWriter(); - Presenter.doXid(htmlCode, this.doc, datas); + Presenter.dynamize(htmlCode, this.doc, datas); result = new StringBuffer(htmlCode.toString()); } @@ -77,6 +69,14 @@ public class DomPresenter extends Presenter return (result); } + /** + * + */ + public StringBuffer dynamize(final Data datas) throws Exception + { + return (dynamize(datas.getIdsDataById())); + } + /** * */ @@ -110,7 +110,7 @@ public class DomPresenter extends Presenter /** * Xid a file with data. */ - static public StringBuffer doXid(final Document doc, final IdsDataById datas) throws Exception + static public StringBuffer dynamize(final Document doc, final IdsDataById datas) throws Exception { StringBuffer result; diff --git a/src/fr/devinsy/xidyn/FilePresenter.java b/src/fr/devinsy/xidyn/FilePresenter.java index a26a4df..93ccd72 100644 --- a/src/fr/devinsy/xidyn/FilePresenter.java +++ b/src/fr/devinsy/xidyn/FilePresenter.java @@ -42,20 +42,20 @@ public class FilePresenter extends DomPresenter * */ @Override - public StringBuffer doXid(final Data datas) throws Exception + public StringBuffer dynamize(final Data datas) throws Exception { - return (doXid(datas.getIdsDataById())); + return (dynamize(datas.getIdsDataById())); } /** * No need to be synchronized. */ @Override - public StringBuffer doXid(final IdsDataById datas) throws Exception + public StringBuffer dynamize(final IdsDataById datas) throws Exception { StringBuffer result; - logger.info("doXid for file [" + this.sourceFilePathname + "]"); + logger.info("dynamize file [" + this.sourceFilePathname + "]"); // Get the good tree. File source = new File(this.sourceFilePathname); @@ -83,7 +83,7 @@ public class FilePresenter extends DomPresenter htmlCode.write(doctype); htmlCode.write('\n'); - Presenter.doXid(htmlCode, doc, datas); + Presenter.dynamize(htmlCode, doc, datas); result = htmlCode.getBuffer(); // @@ -116,30 +116,30 @@ public class FilePresenter extends DomPresenter } /** - * Xid a file without data. + * Dynamize a file without data. */ - static public StringBuffer doXid(final String filePathname) throws Exception + static public StringBuffer dynamize(final String filePathname) throws Exception { StringBuffer result; FilePresenter presenter = new FilePresenter(filePathname); - result = presenter.doXid((Data) null); + result = presenter.dynamize((Data) null); // return (result); } /** - * Xid a file. + * Dynamize a file. */ - static public StringBuffer doXid(final String filePathname, final Data datas) throws Exception + static public StringBuffer dynamize(final String filePathname, final Data datas) throws Exception { StringBuffer result; FilePresenter presenter = new FilePresenter(filePathname); - result = presenter.doXid(datas); + result = presenter.dynamize(datas); // return (result); diff --git a/src/fr/devinsy/xidyn/Presenter.java b/src/fr/devinsy/xidyn/Presenter.java index 69a69bd..0c75158 100644 --- a/src/fr/devinsy/xidyn/Presenter.java +++ b/src/fr/devinsy/xidyn/Presenter.java @@ -137,7 +137,7 @@ public class Presenter /** * Xid a file with data. */ - static public void doXid(final Writer result, final Document doc, final IdsDataById datas) throws Exception + static public void dynamize(final Writer result, final Document doc, final IdsDataById datas) throws Exception { Presenter.process(result, doc, datas); } diff --git a/src/fr/devinsy/xidyn/StringPresenter.java b/src/fr/devinsy/xidyn/StringPresenter.java index 5d0b6ed..cfd9295 100644 --- a/src/fr/devinsy/xidyn/StringPresenter.java +++ b/src/fr/devinsy/xidyn/StringPresenter.java @@ -39,16 +39,16 @@ public class StringPresenter extends DomPresenter * */ @Override - public StringBuffer doXid(final Data datas) throws Exception + public StringBuffer dynamize(final Data datas) throws Exception { - return (doXid(datas.getIdsDataById())); + return (dynamize(datas.getIdsDataById())); } /** * */ @Override - public StringBuffer doXid(final IdsDataById datas) throws Exception + public StringBuffer dynamize(final IdsDataById datas) throws Exception { StringBuffer result; @@ -76,7 +76,7 @@ public class StringPresenter extends DomPresenter { htmlCode.write(this.html.substring(0, this.html.indexOf('>'))); } - Presenter.doXid(htmlCode, doc, datas); + Presenter.dynamize(htmlCode, doc, datas); StringBuffer htmlTarget = htmlCode.getBuffer(); if (htmlTarget == null) @@ -131,21 +131,21 @@ public class StringPresenter extends DomPresenter /** * */ - static public StringBuffer doXid(final String html, final Data datas) throws Exception + static public StringBuffer dynamize(final String html, final Data datas) throws Exception { - return (doXid(html, datas.getIdsDataById())); + return (dynamize(html, datas.getIdsDataById())); } /** * Xid a string with html in. */ - static public StringBuffer doXid(final String html, final IdsDataById datas) throws Exception + static public StringBuffer dynamize(final String html, final IdsDataById datas) throws Exception { StringBuffer result; StringPresenter presenter = new StringPresenter(html); - result = presenter.doXid(datas); + result = presenter.dynamize(datas); // return (result); diff --git a/test/XidTest.java b/test/XidTest.java index 9c6b435..bc0c542 100644 --- a/test/XidTest.java +++ b/test/XidTest.java @@ -66,7 +66,7 @@ class XidTest datas.setContent("name", "Superman"); try { - html = StringPresenter.doXid("
a name
", datas); + html = StringPresenter.dynamize("
a name
", datas); } catch (Exception exception) { @@ -86,7 +86,7 @@ class XidTest try { - html = StringPresenter.doXid("
a last name
", datas); + html = StringPresenter.dynamize("
a last name
", datas); } catch (Exception exception) { @@ -107,7 +107,7 @@ class XidTest try { - html = StringPresenter.doXid("", datas); + html = StringPresenter.dynamize("", datas); } catch (Exception exception) { @@ -139,7 +139,7 @@ class XidTest htmlSource = source.toString(); try { - html = StringPresenter.doXid(htmlSource, datas); + html = StringPresenter.dynamize(htmlSource, datas); } catch (Exception exception) { @@ -197,22 +197,22 @@ class XidTest * * datas.setIterationStrategy ("identity", * IdsDataByIndex.IterationStrategy.ONLY_FIRST_ROW); System.out.println - * ("ONLY_FIRST_ROW:"); html = Presenter.doXid (htmlSource, datas, "", + * ("ONLY_FIRST_ROW:"); html = Presenter.dynamize (htmlSource, datas, "", * errorMessage); System.out.println (html); * * datas.setIterationStrategy ("identity", * IdsDataByIndex.IterationStrategy.ONLY_ROWS_WITH_ID); - * System.out.println ("ONLY_ROWS_WITH_ID:"); html = Presenter.doXid + * System.out.println ("ONLY_ROWS_WITH_ID:"); html = Presenter.dynamize * (htmlSource, datas, "", errorMessage); System.out.println (html); * * datas.setIterationStrategy ("identity", * IdsDataByIndex.IterationStrategy.ONLY_ROWS_WITHOUT_ID); - * System.out.println ("ONLY_ROWS_WITHOUT_ID:"); html = Presenter.doXid + * System.out.println ("ONLY_ROWS_WITHOUT_ID:"); html = Presenter.dynamize * (htmlSource, datas, "", errorMessage); System.out.println (html); * * datas.setIterationStrategy ("identity", * IdsDataByIndex.IterationStrategy.ALL_ROWS); System.out.println - * ("ALL_ROWS:"); html = Presenter.doXid (htmlSource, datas, "", + * ("ALL_ROWS:"); html = Presenter.dynamize (htmlSource, datas, "", * errorMessage); System.out.println (html); * * @@ -227,7 +227,7 @@ class XidTest * source.append ("
\n"); source.append ("

one

\n"); * source.append ("
\n"); source.append ("
\n"); * source.append ("

three

\n"); source.append ("
"); - * htmlSource = source.toString (); html = Presenter.doXid (htmlSource, + * htmlSource = source.toString (); html = Presenter.dynamize (htmlSource, * datas, "", errorMessage); * * System.out.println (htmlSource); System.out.println ("+");