Performed code review and Javadoc review.

This commit is contained in:
Christian P. MOMON 2017-05-05 22:09:02 +02:00
parent 521cc2e633
commit 399b5eb971
37 changed files with 1420 additions and 516 deletions

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2016 Christian Pierre MOMON
/*
* Copyright (C) 2016,2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -19,6 +19,7 @@
package fr.devinsy.xidyn;
/**
* The Class XidynException.
*
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
*/
@ -27,7 +28,7 @@ public class XidynException extends Exception
private static final long serialVersionUID = 8498031594322380559L;
/**
*
* Instantiates a new xidyn exception.
*/
public XidynException()
{
@ -35,8 +36,10 @@ public class XidynException extends Exception
}
/**
* Instantiates a new xidyn exception.
*
* @param message
* the message
*/
public XidynException(final String message)
{
@ -44,9 +47,12 @@ public class XidynException extends Exception
}
/**
* Instantiates a new xidyn exception.
*
* @param message
* the message
* @param cause
* the cause
*/
public XidynException(final String message, final Throwable cause)
{
@ -54,8 +60,10 @@ public class XidynException extends Exception
}
/**
* Instantiates a new xidyn exception.
*
* @param cause
* the cause
*/
public XidynException(final Throwable cause)
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -21,6 +21,8 @@ package fr.devinsy.xidyn.data;
import java.io.Serializable;
/**
* The Class SimpleTagData.
*
* IdData class is used to hold application data and the business logic that
* operates on the data.
*
@ -59,7 +61,7 @@ public class SimpleTagData implements Serializable, TagData
private String content;
/**
*
* Instantiates a new simple tag data.
*/
public SimpleTagData()
{
@ -71,7 +73,10 @@ public class SimpleTagData implements Serializable, TagData
}
/**
* Instantiates a new simple tag data.
*
* @param text
* the text
*/
public SimpleTagData(final String text)
{
@ -83,7 +88,10 @@ public class SimpleTagData implements Serializable, TagData
}
/**
* Append content.
*
* @param text
* the text
*/
public void appendContent(final String text)
{
@ -98,7 +106,9 @@ public class SimpleTagData implements Serializable, TagData
}
/**
* Attributes.
*
* @return the tag attributes
*/
public TagAttributes attributes()
{
@ -116,7 +126,9 @@ public class SimpleTagData implements Serializable, TagData
}
/**
* Display.
*
* @return the string
*/
public String display()
{
@ -129,7 +141,9 @@ public class SimpleTagData implements Serializable, TagData
}
/**
* Display mode.
*
* @return the mode
*/
public MODE displayMode()
{
@ -141,7 +155,9 @@ public class SimpleTagData implements Serializable, TagData
}
/**
* Exclude section.
*
* @return true, if successful
*/
public boolean excludeSection()
{
@ -154,7 +170,9 @@ public class SimpleTagData implements Serializable, TagData
}
/**
* Iteration strategy.
*
* @return the iteration strategy
*/
public IterationStrategy iterationStrategy()
{
@ -167,7 +185,10 @@ public class SimpleTagData implements Serializable, TagData
}
/**
* Sets the content.
*
* @param text
* the new content
*/
public void setContent(final String text)
{
@ -175,7 +196,10 @@ public class SimpleTagData implements Serializable, TagData
}
/**
* Sets the display mode.
*
* @param displayMode
* the new display mode
*/
public void setDisplayMode(final MODE displayMode)
{
@ -183,7 +207,10 @@ public class SimpleTagData implements Serializable, TagData
}
/**
* Sets the exclude section.
*
* @param excludeSection
* the new exclude section
*/
public void setExcludeSection(final boolean excludeSection)
{
@ -191,7 +218,10 @@ public class SimpleTagData implements Serializable, TagData
}
/**
* Sets the iteration strategy.
*
* @param strategy
* the new iteration strategy
*/
public void setIterationStrategy(final IterationStrategy strategy)
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -21,10 +21,12 @@ package fr.devinsy.xidyn.data;
import java.util.HashMap;
/**
* The Class TagAttributes.
*
* Note: no more AttrValue as in Brill, because the exception of style is
* managed in the attribute merging on the "style" string detection.
*/
public class TagAttributes extends HashMap<String, String>
{
private static final long serialVersionUID = 2802739066295665336L;

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -18,12 +18,16 @@
*/
package fr.devinsy.xidyn.data;
/*
* Xidyn uses three classes to describe data:
* - TagData
* - TagsData
* - TagsDataById
/**
* The Interface TagData.
*
* Xidyn uses three classes to describe data:
* <ul>
* <li>TagData</li>
* <li>TagsData</li>
* <li>TagsDataById</li>
* </ul>
* <br/>
* Others classes that do not extends these won't be use by Xidyn.
*
* This interface helps to express this fact.

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -21,15 +21,14 @@ package fr.devinsy.xidyn.data;
import java.util.HashMap;
/**
*
* The Class TagDataListById.
*/
public class TagDataListById extends HashMap<String, TagData> implements TagData
{
private static final long serialVersionUID = -5787252043825503554L;
/**
*
* Instantiates a new tag data list by id.
*/
public TagDataListById()
{
@ -37,7 +36,11 @@ public class TagDataListById extends HashMap<String, TagData> implements TagData
}
/**
* Gets the id.
*
* @param id
* the id
* @return the id
*/
public TagData getId(final String id)
{
@ -50,11 +53,15 @@ public class TagDataListById extends HashMap<String, TagData> implements TagData
}
/**
* Sets the id.
*
* @param id
* the id
* @param data
* the data
*/
public void setId(final String id, final TagData data)
{
this.put(id, data);
}
}

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -21,6 +21,7 @@ package fr.devinsy.xidyn.data;
import java.util.Vector;
/**
* The Class TagDataListByIndex.
*
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
*/
@ -29,7 +30,7 @@ public class TagDataListByIndex extends Vector<TagData> implements TagData
private static final long serialVersionUID = 215545720925753884L;
/**
*
* Instantiates a new tag data list by index.
*/
public TagDataListByIndex()
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -21,6 +21,7 @@ package fr.devinsy.xidyn.data;
import fr.devinsy.xidyn.presenters.DomPresenterCore;
/**
* The Class TagDataManager.
*
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
*/
@ -29,7 +30,7 @@ public class TagDataManager
private TagDataListById idsDataById;
/**
*
* Instantiates a new tag data manager.
*/
public TagDataManager()
{
@ -37,7 +38,12 @@ public class TagDataManager
}
/**
* Adds the content.
*
* @param id
* the id
* @param value
* the value
*/
public void addContent(final String id, final long value)
{
@ -45,7 +51,12 @@ public class TagDataManager
}
/**
* Adds the content.
*
* @param id
* the id
* @param content
* the content
*/
public void addContent(final String id, final String content)
{
@ -64,7 +75,14 @@ public class TagDataManager
}
/**
* Append attribute.
*
* @param id
* the id
* @param label
* the label
* @param value
* the value
*/
public void appendAttribute(final String id, final String label, final long value)
{
@ -72,7 +90,14 @@ public class TagDataManager
}
/**
* Append attribute.
*
* @param id
* the id
* @param label
* the label
* @param value
* the value
*/
public void appendAttribute(final String id, final String label, final String value)
{
@ -82,7 +107,14 @@ public class TagDataManager
}
/**
* Append content.
*
* @param id
* the id
* @param line
* the line
* @param value
* the value
*/
public void appendContent(final String id, final int line, final long value)
{
@ -90,7 +122,14 @@ public class TagDataManager
}
/**
* Append content.
*
* @param id
* the id
* @param line
* the line
* @param value
* the value
*/
public void appendContent(final String id, final int line, final String value)
{
@ -100,7 +139,16 @@ public class TagDataManager
}
/**
* Append content.
*
* @param id
* the id
* @param line
* the line
* @param column
* the column
* @param value
* the value
*/
public void appendContent(final String id, final int line, final String column, final long value)
{
@ -108,7 +156,16 @@ public class TagDataManager
}
/**
* Append content.
*
* @param id
* the id
* @param line
* the line
* @param column
* the column
* @param value
* the value
*/
public void appendContent(final String id, final int line, final String column, final String value)
{
@ -118,7 +175,12 @@ public class TagDataManager
}
/**
* Append content.
*
* @param id
* the id
* @param value
* the value
*/
public void appendContent(final String id, final String value)
{
@ -127,7 +189,11 @@ public class TagDataManager
}
/**
* Gets the id data.
*
* @param id
* the id
* @return the id data
*/
public SimpleTagData getIdData(final String id)
{
@ -148,7 +214,13 @@ public class TagDataManager
}
/**
* Gets the id data.
*
* @param id
* the id
* @param line
* the line
* @return the id data
*/
public SimpleTagData getIdData(final String id, final int line)
{
@ -178,7 +250,15 @@ public class TagDataManager
}
/**
* Gets the id data.
*
* @param id
* the id
* @param line
* the line
* @param column
* the column
* @return the id data
*/
public SimpleTagData getIdData(final String id, final int line, final String column)
{
@ -217,7 +297,9 @@ public class TagDataManager
}
/**
* Gets the ids data by id.
*
* @return the ids data by id
*/
public TagDataListById getIdsDataById()
{
@ -230,8 +312,9 @@ public class TagDataManager
}
/**
* Checks if is empty.
*
* @return
* @return true, if is empty
*/
public boolean isEmpty()
{
@ -251,8 +334,10 @@ public class TagDataManager
}
/**
* Removes the tag.
*
* @param id
* the id
*/
public void removeTag(final String id)
{
@ -262,11 +347,16 @@ public class TagDataManager
}
/**
* Sets the attribute.
*
* @param id
* the id
* @param line
* the line
* @param label
* the label
* @param value
* the value
*/
public void setAttribute(final String id, final int line, final String label, final long value)
{
@ -274,11 +364,16 @@ public class TagDataManager
}
/**
* Sets the attribute.
*
* @param id
* the id
* @param line
* the line
* @param label
* the label
* @param value
* the value
*/
public void setAttribute(final String id, final int line, final String label, final String value)
{
@ -288,12 +383,18 @@ public class TagDataManager
}
/**
* Sets the attribute.
*
* @param id
* the id
* @param line
* the line
* @param column
* the column
* @param label
* the label
* @param value
* the value
*/
public void setAttribute(final String id, final int line, final String column, final String label, final long value)
{
@ -301,7 +402,18 @@ public class TagDataManager
}
/**
* Sets the attribute.
*
* @param id
* the id
* @param line
* the line
* @param column
* the column
* @param label
* the label
* @param value
* the value
*/
public void setAttribute(final String id, final int line, final String column, final String label, final String value)
{
@ -311,7 +423,14 @@ public class TagDataManager
}
/**
* Sets the attribute.
*
* @param id
* the id
* @param label
* the label
* @param value
* the value
*/
public void setAttribute(final String id, final String label, final long value)
{
@ -319,7 +438,14 @@ public class TagDataManager
}
/**
* Sets the attribute.
*
* @param id
* the id
* @param label
* the label
* @param value
* the value
*/
public void setAttribute(final String id, final String label, final String value)
{
@ -329,7 +455,14 @@ public class TagDataManager
}
/**
* Sets the content.
*
* @param id
* the id
* @param line
* the line
* @param value
* the value
*/
public void setContent(final String id, final int line, final long value)
{
@ -337,7 +470,14 @@ public class TagDataManager
}
/**
* Sets the content.
*
* @param id
* the id
* @param line
* the line
* @param content
* the content
*/
public void setContent(final String id, final int line, final String content)
{
@ -347,6 +487,20 @@ public class TagDataManager
}
/**
* Sets the content.
*
* @param id
* the id
* @param line
* the line
* @param subId
* the sub id
* @param subLine
* the sub line
* @param column
* the column
* @param content
* the content
* @TODO
*/
public void setContent(final String id, final int line, final String subId, final int subLine, final String column, final String content)
@ -357,7 +511,16 @@ public class TagDataManager
}
/**
* Sets the content.
*
* @param id
* the id
* @param line
* the line
* @param column
* the column
* @param value
* the value
*/
public void setContent(final String id, final int line, final String column, final long value)
{
@ -365,7 +528,16 @@ public class TagDataManager
}
/**
* Sets the content.
*
* @param id
* the id
* @param line
* the line
* @param column
* the column
* @param content
* the content
*/
public void setContent(final String id, final int line, final String column, final String content)
{
@ -375,7 +547,12 @@ public class TagDataManager
}
/**
* Sets the content.
*
* @param id
* the id
* @param value
* the value
*/
public void setContent(final String id, final long value)
{
@ -383,7 +560,12 @@ public class TagDataManager
}
/**
* Sets the content.
*
* @param id
* the id
* @param content
* the content
*/
public void setContent(final String id, final String content)
{
@ -393,7 +575,12 @@ public class TagDataManager
}
/**
* Sets the iteration strategy.
*
* @param id
* the id
* @param strategy
* the strategy
*/
public void setIterationStrategy(final String id, final SimpleTagData.IterationStrategy strategy)
{

View file

@ -1,6 +1,5 @@
package fr.devinsy.xidyn.demo;
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -17,6 +16,8 @@ package fr.devinsy.xidyn.demo;
* You should have received a copy of the GNU General Public License
* along with Xidyn. If not, see <http://www.gnu.org/licenses/>
*/
package fr.devinsy.xidyn.demo;
import org.apache.log4j.Level;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -27,11 +28,11 @@ import fr.devinsy.xidyn.data.TagDataManager;
import fr.devinsy.xidyn.presenters.PresenterUtils;
/**
*
* The Class XidynDemo.
*/
class XidynDemo
{
private static Logger logger = LoggerFactory.getLogger(XidynDemo.class);
private final Logger logger = LoggerFactory.getLogger(XidynDemo.class);
static
{
// Initialize logger.
@ -40,7 +41,10 @@ class XidynDemo
}
/**
* The main method.
*
* @param args
* the arguments
*/
public static void main(final String[] args)
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2016 Christian Pierre MOMON
/*
* Copyright (C) 2016,2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -33,7 +33,7 @@ import fr.devinsy.xidyn.presenters.URLPresenter;
import fr.devinsy.xidyn.utils.XidynUtils;
/**
*
* The Class Page.
*/
public class Page extends TagDataManager
{
@ -41,8 +41,10 @@ public class Page extends TagDataManager
private StringBuffer lastDynamize;
/**
* Instantiates a new page.
*
* @param source
* the source
*/
public Page(final CharSequence source)
{
@ -50,8 +52,12 @@ public class Page extends TagDataManager
}
/**
* Instantiates a new page.
*
* @param source
* the source
* @param locale
* the locale
*/
public Page(final CharSequence source, final Locale locale)
{
@ -59,8 +65,10 @@ public class Page extends TagDataManager
}
/**
* Instantiates a new page.
*
* @param source
* the source
*/
public Page(final Document source)
{
@ -68,8 +76,10 @@ public class Page extends TagDataManager
}
/**
* Instantiates a new page.
*
* @param source
* the source
*/
public Page(final File source)
{
@ -77,8 +87,12 @@ public class Page extends TagDataManager
}
/**
* Instantiates a new page.
*
* @param source
* the source
* @param locale
* the locale
*/
public Page(final File source, final Locale locale)
{
@ -86,7 +100,10 @@ public class Page extends TagDataManager
}
/**
* Instantiates a new page.
*
* @param presenter
* the presenter
*/
public Page(final Presenter presenter)
{
@ -104,8 +121,10 @@ public class Page extends TagDataManager
}
/**
* Instantiates a new page.
*
* @param source
* the source
*/
public Page(final URL source)
{
@ -113,8 +132,12 @@ public class Page extends TagDataManager
}
/**
* Instantiates a new page.
*
* @param source
* the source
* @param locale
* the locale
*/
public Page(final URL source, final Locale locale)
{
@ -122,9 +145,11 @@ public class Page extends TagDataManager
}
/**
* Dynamize.
*
* @return
* @return the string buffer
* @throws Exception
* the exception
*/
public StringBuffer dynamize() throws Exception
{
@ -146,9 +171,11 @@ public class Page extends TagDataManager
}
/**
* Dynamize to string.
*
* @return
* @return the string
* @throws Exception
* the exception
*/
public String dynamizeToString() throws Exception
{
@ -170,10 +197,14 @@ public class Page extends TagDataManager
}
/**
* Include.
*
* @param id
* @param page
* the id
* @param source
* the source
* @throws Exception
* the exception
*/
public void include(final String id, final Page source) throws Exception
{
@ -214,10 +245,14 @@ public class Page extends TagDataManager
}
/**
* Include page.
*
* @param id
* @param page
* the id
* @param source
* the source
* @throws Exception
* the exception
*/
public void includePage(final String id, final CharSequence source) throws Exception
{
@ -230,10 +265,14 @@ public class Page extends TagDataManager
}
/**
* Include page.
*
* @param id
* @param page
* the id
* @param source
* the source
* @throws Exception
* the exception
*/
public void includePage(final String id, final Document source) throws Exception
{
@ -246,10 +285,14 @@ public class Page extends TagDataManager
}
/**
* Include page.
*
* @param id
* @param page
* the id
* @param source
* the source
* @throws Exception
* the exception
*/
public void includePage(final String id, final File source) throws Exception
{
@ -262,10 +305,14 @@ public class Page extends TagDataManager
}
/**
* Include page.
*
* @param id
* @param page
* the id
* @param source
* the source
* @throws Exception
* the exception
*/
public void includePage(final String id, final URL source) throws Exception
{
@ -278,8 +325,9 @@ public class Page extends TagDataManager
}
/**
* Checks if is complete.
*
* @return
* @return true, if is complete
*/
public boolean isComplete()
{
@ -299,7 +347,11 @@ public class Page extends TagDataManager
}
/**
* Last version.
*
* @return the string buffer
* @throws Exception
* the exception
*/
public StringBuffer lastVersion() throws Exception
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2016 Christian Pierre MOMON
/*
* Copyright (C) 2016,2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -29,6 +29,7 @@ import fr.devinsy.xidyn.presenters.PresenterFactory;
import fr.devinsy.xidyn.utils.cache.Cache;
/**
* A factory for creating Page objects.
*
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
*/
@ -47,7 +48,7 @@ public class PageFactory
private Cache<Page> cache;
/**
*
* Instantiates a new page factory.
*/
private PageFactory()
{
@ -55,7 +56,7 @@ public class PageFactory
}
/**
*
* Clear.
*/
public void clear()
{
@ -64,9 +65,11 @@ public class PageFactory
}
/**
* Creates the.
*
* @param source
* @return
* the source
* @return the page
*/
public Page create(final CharSequence source)
{
@ -79,9 +82,11 @@ public class PageFactory
}
/**
* Creates the.
*
* @param source
* @return
* the source
* @return the page
*/
public Page create(final Document source)
{
@ -94,9 +99,11 @@ public class PageFactory
}
/**
* Creates the.
*
* @param source
* @return
* the source
* @return the page
*/
public Page create(final File source)
{
@ -109,9 +116,13 @@ public class PageFactory
}
/**
* Creates the.
*
* @param source
* @return
* the source
* @param locale
* the locale
* @return the page
*/
public Page create(final File source, final Locale locale)
{
@ -124,9 +135,11 @@ public class PageFactory
}
/**
* Creates the.
*
* @param source
* @return
* the source
* @return the page
*/
public Page create(final URL source)
{
@ -139,9 +152,13 @@ public class PageFactory
}
/**
* Creates the.
*
* @param source
* @return
* the source
* @param locale
* the locale
* @return the page
*/
public Page create(final URL source, final Locale locale)
{
@ -154,11 +171,13 @@ public class PageFactory
}
/**
* Gets the.
*
* @param source
* @param parameters
* @return
* @throws Exception
* the source
* @param keys
* the keys
* @return the page
*/
public Page get(final Document source, final String... keys)
{
@ -178,10 +197,13 @@ public class PageFactory
}
/**
* Gets the.
*
* @param source
* @param parameters
* @return
* the source
* @param keys
* the keys
* @return the page
*/
public Page get(final File source, final String... keys)
{
@ -201,10 +223,13 @@ public class PageFactory
}
/**
* Gets the.
*
* @param source
* @param parameters
* @return
* the source
* @param keys
* the keys
* @return the page
*/
public Page get(final String source, final String... keys)
{
@ -224,10 +249,13 @@ public class PageFactory
}
/**
* Gets the.
*
* @param source
* @param parameters
* @return
* the source
* @param keys
* the keys
* @return the page
*/
public Page get(final URL source, final String... keys)
{
@ -247,8 +275,9 @@ public class PageFactory
}
/**
* Size.
*
* @return
* @return the int
*/
public int size()
{
@ -261,8 +290,9 @@ public class PageFactory
}
/**
* Instance.
*
* @return
* @return the page factory
*/
public static PageFactory instance()
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -28,7 +28,7 @@ import fr.devinsy.xidyn.data.TagDataManager;
import fr.devinsy.xidyn.utils.XidynUtils;
/**
*
* The Class DomPresenter.
*/
public class DomPresenter implements Presenter
{
@ -38,7 +38,7 @@ public class DomPresenter implements Presenter
private StringBuffer defaultHtmlTarget;
/**
*
* Instantiates a new dom presenter.
*/
public DomPresenter()
{
@ -47,7 +47,10 @@ public class DomPresenter implements Presenter
}
/**
* Instantiates a new dom presenter.
*
* @param doc
* the doc
*/
public DomPresenter(final Document doc)
{
@ -107,7 +110,9 @@ public class DomPresenter implements Presenter
}
/**
* Gets the dom.
*
* @return the dom
*/
public Document getDOM()
{
@ -169,7 +174,10 @@ public class DomPresenter implements Presenter
}
/**
* Sets the dom.
*
* @param doc
* the new dom
*/
public void setDOM(final Document doc)
{
@ -178,7 +186,10 @@ public class DomPresenter implements Presenter
}
/**
* Sets the source.
*
* @param doc
* the new source
*/
public void setSource(final Document doc)
{
@ -187,9 +198,8 @@ public class DomPresenter implements Presenter
this.isOutdated = true;
}
/**
*
* @throws Exception
/* (non-Javadoc)
* @see fr.devinsy.xidyn.presenters.Presenter#update()
*/
@Override
public void update() throws Exception

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -42,7 +42,7 @@ import fr.devinsy.xidyn.data.TagDataManager;
import fr.devinsy.xidyn.utils.XidynUtils;
/**
*
* The Class DomPresenterCore.
*/
public class DomPresenterCore
{
@ -53,6 +53,14 @@ public class DomPresenterCore
/**
* Dynamize a doc with data.
*
* @param doc
* the doc
* @param data
* the data
* @return the string buffer
* @throws Exception
* the exception
*/
public static StringBuffer dynamize(final Document doc, final TagDataListById data) throws Exception
{
@ -68,6 +76,14 @@ public class DomPresenterCore
/**
* Dynamize a doc with data.
*
* @param doc
* the doc
* @param data
* the data
* @return the string buffer
* @throws Exception
* the exception
*/
public static StringBuffer dynamize(final Document doc, final TagDataManager data) throws Exception
{
@ -81,6 +97,15 @@ public class DomPresenterCore
/**
* 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
{
@ -89,6 +114,15 @@ public class DomPresenterCore
/**
* 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
{
@ -96,7 +130,11 @@ public class DomPresenterCore
}
/**
* Gets the class attribute value.
*
* @param node
* the node
* @return the class attribute value
*/
private static String getClassAttributeValue(final Node node)
{
@ -129,6 +167,8 @@ public class DomPresenterCore
* Get the text for an element. Converts new lines to spaces.
*
* @param node
* the node
* @return the element text
*/
private static String getElementText(final Node node)
{
@ -174,7 +214,13 @@ public class DomPresenterCore
}
/**
* Merge attributes.
*
* @param target
* the target
* @param source
* the source
* @return the tag attributes
*/
private static TagAttributes mergeAttributes(final TagAttributes target, final TagAttributes source)
{
@ -245,7 +291,16 @@ public class DomPresenterCore
}
/**
* Process.
*
* @param result
* the result
* @param node
* the node
* @param data
* the data
* @throws Exception
* the exception
*/
private static void process(final Writer result, final Node node, final TagDataListById data) throws Exception
{
@ -255,6 +310,16 @@ public class DomPresenterCore
/**
* Recursive method that processes a node and any child nodes.
*
* @param result
* the result
* @param node
* the node
* @param datas
* the datas
* @param suffix
* the suffix
* @throws Exception
* the exception
*/
private static void process(final Writer result, final Node node, final TagDataListById datas, final String suffix) throws Exception
{
@ -375,7 +440,11 @@ public class DomPresenterCore
}
/**
* Process attributes.
*
* @param attrs
* the attrs
* @return the string buffer
*/
private static StringBuffer processAttributes(final NamedNodeMap attrs)
{
@ -388,7 +457,13 @@ public class DomPresenterCore
}
/**
* Process attributes.
*
* @param attrs
* the attrs
* @param dataAttributes
* the data attributes
* @return the string buffer
*/
private static StringBuffer processAttributes(final NamedNodeMap attrs, final TagAttributes dataAttributes)
{
@ -401,7 +476,15 @@ public class DomPresenterCore
}
/**
* Process attributes.
*
* @param attrs
* the attrs
* @param dataAttributes
* the data attributes
* @param suffix
* the suffix
* @return the string buffer
*/
private static StringBuffer processAttributes(final NamedNodeMap attrs, final TagAttributes dataAttributes, final String suffix)
{
@ -466,7 +549,17 @@ public class DomPresenterCore
}
/**
* Process attributes.
*
* @param attrs
* the attrs
* @param dataAttributes
* the data attributes
* @param namedDataAttributes
* the named data attributes
* @param suffix
* the suffix
* @return the string buffer
*/
private static StringBuffer processAttributes(final NamedNodeMap attrs, final TagAttributes dataAttributes, final TagAttributes namedDataAttributes, final String suffix)
{
@ -479,7 +572,16 @@ public class DomPresenterCore
}
/**
* Process children.
*
* @param result
* the result
* @param node
* the node
* @param datas
* the datas
* @throws Exception
* the exception
*/
private static void processChildren(final Writer result, final Node node, final TagDataListById datas) throws Exception
{
@ -487,7 +589,18 @@ public class DomPresenterCore
}
/**
* Process children.
*
* @param result
* the result
* @param node
* the node
* @param datas
* the datas
* @param suffix
* the suffix
* @throws Exception
* the exception
*/
private static void processChildren(final Writer result, final Node node, final TagDataListById datas, final String suffix) throws Exception
{
@ -618,7 +731,16 @@ public class DomPresenterCore
}
/**
* TODO remove?
* TODO remove?.
*
* @param result
* the result
* @param node
* the node
* @param datas
* the datas
* @throws Exception
* the exception
*/
private static void processElementBasically(final Writer result, final Node node, final TagDataListById datas) throws Exception
{
@ -626,7 +748,18 @@ public class DomPresenterCore
}
/**
* Process element basically.
*
* @param result
* the result
* @param node
* the node
* @param datas
* the datas
* @param suffix
* the suffix
* @throws Exception
* the exception
*/
private static void processElementBasically(final Writer result, final Node node, final TagDataListById datas, final String suffix) throws Exception
{
@ -664,12 +797,18 @@ public class DomPresenterCore
* Processes a node that has dynamic content. Calls the appropriate code
* generator method, depending on the tag.
*
* @param result
* the result
* @param node
* Current node.
* @param attrs
* The tag attributes.
* @param idAttr
* The ID.
* @param datas
* the datas
* @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
@ -681,12 +820,20 @@ public class DomPresenterCore
* Processes a node that has dynamic content. Calls the appropriate code
* generator method, depending on the tag.
*
* @param result
* the result
* @param node
* Current node.
* @param attrs
* The tag attributes.
* @param idAttr
* The ID.
* @param datas
* the datas
* @param suffix
* the suffix
* @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
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -29,7 +29,7 @@ import fr.devinsy.xidyn.data.TagDataManager;
import fr.devinsy.xidyn.utils.XidynUtils;
/**
*
* The Class FilePresenter.
*/
public class FilePresenter extends StringPresenter
{
@ -40,7 +40,7 @@ public class FilePresenter extends StringPresenter
private long sourceTime;
/**
*
* Instantiates a new file presenter.
*/
public FilePresenter()
{
@ -48,7 +48,10 @@ public class FilePresenter extends StringPresenter
}
/**
* Instantiates a new file presenter.
*
* @param source
* the source
*/
public FilePresenter(final File source)
{
@ -56,7 +59,10 @@ public class FilePresenter extends StringPresenter
}
/**
* Instantiates a new file presenter.
*
* @param filePathname
* the file pathname
*/
public FilePresenter(final String filePathname)
{
@ -104,7 +110,9 @@ public class FilePresenter extends StringPresenter
}
/**
* Gets the file.
*
* @return the file
*/
public File getFile()
{
@ -178,7 +186,10 @@ public class FilePresenter extends StringPresenter
}
/**
* Sets the source.
*
* @param source
* the new source
*/
public void setSource(final File source)
{
@ -200,8 +211,10 @@ public class FilePresenter extends StringPresenter
}
/**
* @throws Exception
* Sets the source.
*
* @param source
* the new source
*/
@Override
public void setSource(final String source)
@ -234,7 +247,10 @@ public class FilePresenter extends StringPresenter
}
/**
* Update.
*
* @throws Exception
* the exception
*/
@Override
public void update() throws Exception

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -24,7 +24,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* The Class FilePresenters.
*/
public class FilePresenters extends Vector<FilePresenter>
{
@ -32,7 +32,7 @@ public class FilePresenters extends Vector<FilePresenter>
private static Logger logger = LoggerFactory.getLogger(FilePresenters.class);
/**
*
* Instantiates a new file presenters.
*/
public FilePresenters()
{
@ -40,7 +40,10 @@ public class FilePresenters extends Vector<FilePresenter>
}
/**
* Instantiates a new file presenters.
*
* @param source
* the source
*/
public FilePresenters(final FilePresenters source)
{
@ -52,7 +55,11 @@ public class FilePresenters extends Vector<FilePresenter>
}
/**
* Exists.
*
* @param source
* the source
* @return true, if successful
*/
public boolean exists(final String source)
{
@ -72,7 +79,11 @@ public class FilePresenters extends Vector<FilePresenter>
}
/**
* Gets the by index.
*
* @param id
* the id
* @return the by index
*/
public FilePresenter getByIndex(final int id)
{
@ -85,7 +96,11 @@ public class FilePresenters extends Vector<FilePresenter>
}
/**
* Gets the by source.
*
* @param source
* the source
* @return the by source
*/
public FilePresenter getBySource(final String source)
{
@ -129,7 +144,11 @@ public class FilePresenters extends Vector<FilePresenter>
}
/**
* Gets the index of.
*
* @param source
* the source
* @return the index of
*/
public int getIndexOf(final String source)
{
@ -172,8 +191,8 @@ public class FilePresenters extends Vector<FilePresenter>
return result;
}
/**
*
/* (non-Javadoc)
* @see java.util.Vector#toString()
*/
@Override
public String toString()

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -22,7 +22,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* The Class FilePresentersProxy.
*/
public class FilePresentersProxy
{
@ -32,7 +32,10 @@ public class FilePresentersProxy
private FilePresenters presenters = null;
/**
* Instantiates a new file presenters proxy.
*
* @throws Exception
* the exception
*/
protected FilePresentersProxy() throws Exception
{
@ -40,7 +43,13 @@ public class FilePresentersProxy
}
/**
* Gets the by source.
*
* @param source
* the source
* @return the by source
* @throws Exception
* the exception
*/
public FilePresenter getBySource(final String source) throws Exception
{
@ -65,7 +74,11 @@ public class FilePresentersProxy
}
/**
* Instance.
*
* @return the file presenters proxy
* @throws Exception
* the exception
*/
public static FilePresentersProxy instance() throws Exception
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -26,7 +26,7 @@ import org.w3c.dom.Document;
import fr.devinsy.xidyn.data.TagDataManager;
/**
*
* The Class GenericPresenter.
*/
public class GenericPresenter implements Presenter
{
@ -35,7 +35,10 @@ public class GenericPresenter implements Presenter
private Presenter presenter;
/**
* Instantiates a new generic presenter.
*
* @param source
* the source
*/
public GenericPresenter(final Document source)
{
@ -50,7 +53,10 @@ public class GenericPresenter implements Presenter
}
/**
* Instantiates a new generic presenter.
*
* @param source
* the source
*/
public GenericPresenter(final File source)
{
@ -65,7 +71,10 @@ public class GenericPresenter implements Presenter
}
/**
* Instantiates a new generic presenter.
*
* @param source
* the source
*/
public GenericPresenter(final String source)
{
@ -80,7 +89,10 @@ public class GenericPresenter implements Presenter
}
/**
* Instantiates a new generic presenter.
*
* @param source
* the source
*/
public GenericPresenter(final URL source)
{
@ -94,8 +106,8 @@ public class GenericPresenter implements Presenter
}
}
/**
*
/* (non-Javadoc)
* @see fr.devinsy.xidyn.presenters.Presenter#dynamize()
*/
@Override
public StringBuffer dynamize() throws Exception
@ -108,8 +120,8 @@ public class GenericPresenter implements Presenter
return result;
}
/**
*
/* (non-Javadoc)
* @see fr.devinsy.xidyn.presenters.Presenter#dynamize(fr.devinsy.xidyn.data.TagDataManager)
*/
@Override
public StringBuffer dynamize(final TagDataManager datas) throws Exception
@ -122,8 +134,8 @@ public class GenericPresenter implements Presenter
return result;
}
/**
*
/* (non-Javadoc)
* @see fr.devinsy.xidyn.presenters.Presenter#getSource()
*/
@Override
public Object getSource()
@ -150,8 +162,8 @@ public class GenericPresenter implements Presenter
return result;
}
/**
*
/* (non-Javadoc)
* @see fr.devinsy.xidyn.presenters.Presenter#isOutdated()
*/
@Override
public boolean isOutdated() throws Exception
@ -165,8 +177,10 @@ public class GenericPresenter implements Presenter
}
/**
* Sets the source.
*
* @param source
* the new source
*/
public void setSource(final Document source)
{
@ -181,8 +195,10 @@ public class GenericPresenter implements Presenter
}
/**
* Sets the source.
*
* @param source
* the new source
*/
public void setSource(final File source)
{
@ -197,8 +213,10 @@ public class GenericPresenter implements Presenter
}
/**
* Sets the source.
*
* @param source
* the new source
*/
public void setSource(final String source)
{
@ -213,8 +231,10 @@ public class GenericPresenter implements Presenter
}
/**
* Sets the source.
*
* @param source
* the new source
*/
public void setSource(final URL source)
{
@ -229,7 +249,13 @@ public class GenericPresenter implements Presenter
}
/**
* To string.
*
* @param language
* the language
* @return the string
* @throws Exception
* the exception
*/
public String toString(final String language) throws Exception
{
@ -241,14 +267,13 @@ public class GenericPresenter implements Presenter
return result;
}
/**
*
/* (non-Javadoc)
* @see fr.devinsy.xidyn.presenters.Presenter#update()
*/
@Override
public void update() throws Exception
{
this.presenter.update();
}
}

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -21,6 +21,8 @@ package fr.devinsy.xidyn.presenters;
import fr.devinsy.xidyn.data.TagDataManager;
/**
* The Interface Presenter.
*
* This objectives of a presenter are:
* <ul>
* <li>return the untouched source if there is no tag data (<i>dynamize()</i>)
@ -30,43 +32,55 @@ import fr.devinsy.xidyn.data.TagDataManager;
*/
public interface Presenter
{
/**
* Dynamize.
*
* @param datas
* @return
* @return the string buffer
* @throws Exception
* the exception
*/
public StringBuffer dynamize() throws Exception;
/**
* Dynamize.
*
* @param datas
* @return
* the datas
* @return the string buffer
* @throws Exception
* the exception
*/
public StringBuffer dynamize(final TagDataManager datas) throws Exception;
/**
* Gets the source.
*
* @return
* @return the source
*/
public Object getSource();
/**
* This method check if the source exists and it is readable.
*
* @return
* @return true, if is available
*/
public boolean isAvailable();
/**
* Checks if is outdated.
*
* @return
* @return true, if is outdated
* @throws Exception
* the exception
*/
public boolean isOutdated() throws Exception;
/**
* Update.
*
* @throws Exception
* the exception
*/
public void update() throws Exception;
}

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -31,7 +31,7 @@ import fr.devinsy.util.FileTools;
import fr.devinsy.xidyn.utils.cache.Cache;
/**
*
* A factory for creating Presenter objects.
*/
public class PresenterFactory
{
@ -49,7 +49,7 @@ public class PresenterFactory
private Cache<Presenter> cache;
/**
*
* Instantiates a new presenter factory.
*/
private PresenterFactory()
{
@ -57,7 +57,7 @@ public class PresenterFactory
}
/**
*
* Clear.
*/
public void clear()
{
@ -65,9 +65,11 @@ public class PresenterFactory
}
/**
* Gets the.
*
* @param source
* @return
* the source
* @return the presenter
*/
public Presenter get(final CharSequence source)
{
@ -86,9 +88,13 @@ public class PresenterFactory
}
/**
* Gets the.
*
* @param source
* @return
* the source
* @param locale
* the locale
* @return the presenter
*/
public Presenter get(final CharSequence source, final Locale locale)
{
@ -126,9 +132,11 @@ public class PresenterFactory
}
/**
* Gets the.
*
* @param source
* @return
* the source
* @return the presenter
*/
public Presenter get(final Document source)
{
@ -147,9 +155,11 @@ public class PresenterFactory
}
/**
* Gets the.
*
* @param source
* @return
* the source
* @return the presenter
*/
public Presenter get(final File source)
{
@ -168,9 +178,13 @@ public class PresenterFactory
}
/**
* Gets the.
*
* @param source
* @return
* the source
* @param locale
* the locale
* @return the presenter
*/
public Presenter get(final File source, final Locale locale)
{
@ -208,9 +222,11 @@ public class PresenterFactory
}
/**
* Gets the.
*
* @param source
* @return
* the source
* @return the presenter
*/
public Presenter get(final URL source)
{
@ -229,10 +245,13 @@ public class PresenterFactory
}
/**
* Gets the.
*
* @param source
* @return
* @throws MalformedURLException
* the source
* @param locale
* the locale
* @return the presenter
*/
public Presenter get(final URL source, final Locale locale)
{
@ -280,8 +299,9 @@ public class PresenterFactory
}
/**
* Size.
*
* @return
* @return the int
*/
public int size()
{
@ -294,9 +314,11 @@ public class PresenterFactory
}
/**
* Creates the.
*
* @param source
* @return
* the source
* @return the presenter
*/
public static Presenter create(final CharSequence source)
{
@ -339,9 +361,13 @@ public class PresenterFactory
}
/**
* Creates the.
*
* @param source
* @return
* the source
* @param locale
* the locale
* @return the presenter
*/
public static Presenter create(final CharSequence source, final Locale locale)
{
@ -372,9 +398,11 @@ public class PresenterFactory
}
/**
* Creates the.
*
* @param source
* @return
* the source
* @return the presenter
*/
public static Presenter create(final Document source)
{
@ -394,9 +422,11 @@ public class PresenterFactory
}
/**
* Creates the.
*
* @param source
* @return
* the source
* @return the presenter
*/
public static Presenter create(final File source)
{
@ -416,10 +446,13 @@ public class PresenterFactory
}
/**
* Creates the.
*
* @param source
* the source
* @param locale
* @return
* the locale
* @return the presenter
*/
public static Presenter create(final File source, final Locale locale)
{
@ -450,9 +483,11 @@ public class PresenterFactory
}
/**
* Creates the.
*
* @param source
* @return
* the source
* @return the presenter
*/
public static Presenter create(final URL source)
{
@ -472,9 +507,13 @@ public class PresenterFactory
}
/**
* Creates the.
*
* @param source
* @return
* the source
* @param locale
* the locale
* @return the presenter
*/
public static Presenter create(final URL source, final Locale locale)
{
@ -513,8 +552,9 @@ public class PresenterFactory
}
/**
* Instance.
*
* @return
* @return the presenter factory
*/
public static PresenterFactory instance()
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -28,25 +28,29 @@ import fr.devinsy.xidyn.data.TagDataListById;
import fr.devinsy.xidyn.data.TagDataManager;
/**
*
* The Class PresenterUtils.
*/
public class PresenterUtils
{
private static Logger logger = LoggerFactory.getLogger(PresenterUtils.class);
/**
*
* Instantiates a new presenter utils.
*/
private PresenterUtils()
{
}
/**
* Dynamize.
*
* @param doc
* the doc
* @param data
* @return
* the data
* @return the string buffer
* @throws Exception
* the exception
*/
public static StringBuffer dynamize(final Document doc, final TagDataListById data) throws Exception
{
@ -59,11 +63,15 @@ public class PresenterUtils
}
/**
* Dynamize.
*
* @param doc
* the doc
* @param data
* @return
* the data
* @return the string buffer
* @throws Exception
* the exception
*/
public static StringBuffer dynamize(final Document doc, final TagDataManager data) throws Exception
{
@ -77,6 +85,12 @@ public class PresenterUtils
/**
* Dynamize a file without data.
*
* @param source
* the source
* @return the string buffer
* @throws Exception
* the exception
*/
public static StringBuffer dynamize(final File source) throws Exception
{
@ -92,6 +106,14 @@ public class PresenterUtils
/**
* Dynamize a file.
*
* @param source
* the source
* @param datas
* the datas
* @return the string buffer
* @throws Exception
* the exception
*/
public static StringBuffer dynamize(final File source, final TagDataManager datas) throws Exception
{
@ -108,6 +130,14 @@ public class PresenterUtils
/**
* Dynamize a string with HTML in, or with file path name in, or with URL
* in.
*
* @param source
* the source
* @param datas
* the datas
* @return the string buffer
* @throws Exception
* the exception
*/
public static StringBuffer dynamize(final String source, final TagDataManager datas) throws Exception
{
@ -122,9 +152,11 @@ public class PresenterUtils
}
/**
* Checks for html tag.
*
* @param source
* @return
* the source
* @return true, if successful
*/
public static boolean hasHtmlTag(final String source)
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -28,7 +28,7 @@ import fr.devinsy.xidyn.data.TagDataManager;
import fr.devinsy.xidyn.utils.XidynUtils;
/**
*
* The Class StringPresenter.
*/
public class StringPresenter implements Presenter
{
@ -39,7 +39,7 @@ public class StringPresenter implements Presenter
private Document dom;
/**
*
* Instantiates a new string presenter.
*/
public StringPresenter()
{
@ -47,7 +47,10 @@ public class StringPresenter implements Presenter
}
/**
* Instantiates a new string presenter.
*
* @param html
* the html
*/
public StringPresenter(final String html)
{
@ -215,7 +218,10 @@ public class StringPresenter implements Presenter
}
/**
* Sets the source.
*
* @param html
* the new source
*/
public void setSource(final String html)
{
@ -224,8 +230,8 @@ public class StringPresenter implements Presenter
this.dom = null;
}
/**
*
/* (non-Javadoc)
* @see fr.devinsy.xidyn.presenters.Presenter#update()
*/
@Override
public void update() throws Exception

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -26,7 +26,7 @@ import fr.devinsy.util.FileTools;
import fr.devinsy.xidyn.data.TagDataManager;
/**
*
* The Class TranslatorPresenter.
*/
public class TranslatorPresenter implements Presenter
{
@ -35,7 +35,10 @@ public class TranslatorPresenter implements Presenter
private Map<String, Presenter> presenters;
/**
* Instantiates a new translator presenter.
*
* @param defaultSource
* the default source
*/
public TranslatorPresenter(final String defaultSource)
{
@ -51,8 +54,8 @@ public class TranslatorPresenter implements Presenter
}
}
/**
*
/* (non-Javadoc)
* @see fr.devinsy.xidyn.presenters.Presenter#dynamize()
*/
@Override
public StringBuffer dynamize() throws Exception
@ -74,7 +77,13 @@ public class TranslatorPresenter implements Presenter
}
/**
* Dynamize.
*
* @param locale
* the locale
* @return the string buffer
* @throws Exception
* the exception
*/
public StringBuffer dynamize(final Locale locale) throws Exception
{
@ -99,7 +108,13 @@ public class TranslatorPresenter implements Presenter
}
/**
* Dynamize.
*
* @param language
* the language
* @return the string buffer
* @throws Exception
* the exception
*/
public StringBuffer dynamize(final String language) throws Exception
{
@ -111,8 +126,8 @@ public class TranslatorPresenter implements Presenter
return result;
}
/**
*
/* (non-Javadoc)
* @see fr.devinsy.xidyn.presenters.Presenter#dynamize(fr.devinsy.xidyn.data.TagDataManager)
*/
@Override
public StringBuffer dynamize(final TagDataManager datas) throws Exception
@ -134,7 +149,15 @@ public class TranslatorPresenter implements Presenter
}
/**
* Dynamize.
*
* @param datas
* the datas
* @param locale
* the locale
* @return the string buffer
* @throws Exception
* the exception
*/
public StringBuffer dynamize(final TagDataManager datas, final Locale locale) throws Exception
{
@ -159,7 +182,15 @@ public class TranslatorPresenter implements Presenter
}
/**
* Dynamize.
*
* @param datas
* the datas
* @param language
* the language
* @return the string buffer
* @throws Exception
* the exception
*/
public StringBuffer dynamize(final TagDataManager datas, final String language) throws Exception
{
@ -172,7 +203,13 @@ public class TranslatorPresenter implements Presenter
}
/**
* Gets the presenter.
*
* @param locale
* the locale
* @return the presenter
* @throws Exception
* the exception
*/
public Presenter getPresenter(final Locale locale) throws Exception
{
@ -197,7 +234,13 @@ public class TranslatorPresenter implements Presenter
}
/**
* Gets the presenter.
*
* @param language
* the language
* @return the presenter
* @throws Exception
* the exception
*/
public Presenter getPresenter(final String language) throws Exception
{
@ -253,8 +296,8 @@ public class TranslatorPresenter implements Presenter
return result;
}
/**
*
/* (non-Javadoc)
* @see fr.devinsy.xidyn.presenters.Presenter#getSource()
*/
@Override
public Object getSource()
@ -267,8 +310,8 @@ public class TranslatorPresenter implements Presenter
return result;
}
/**
*
/* (non-Javadoc)
* @see fr.devinsy.xidyn.presenters.Presenter#isAvailable()
*/
@Override
public boolean isAvailable()
@ -288,8 +331,8 @@ public class TranslatorPresenter implements Presenter
return result;
}
/**
*
/* (non-Javadoc)
* @see fr.devinsy.xidyn.presenters.Presenter#isOutdated()
*/
@Override
public boolean isOutdated() throws Exception
@ -298,7 +341,13 @@ public class TranslatorPresenter implements Presenter
}
/**
* To string.
*
* @param locale
* the locale
* @return the string
* @throws Exception
* the exception
*/
public String toString(final Locale locale) throws Exception
{
@ -323,7 +372,13 @@ public class TranslatorPresenter implements Presenter
}
/**
* To string.
*
* @param language
* the language
* @return the string
* @throws Exception
* the exception
*/
public String toString(final String language) throws Exception
{
@ -343,6 +398,9 @@ public class TranslatorPresenter implements Presenter
return result;
}
/* (non-Javadoc)
* @see fr.devinsy.xidyn.presenters.Presenter#update()
*/
@Override
public void update() throws Exception
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -29,7 +29,7 @@ import fr.devinsy.xidyn.data.TagDataManager;
import fr.devinsy.xidyn.utils.XidynUtils;
/**
*
* The Class URLPresenter.
*/
public class URLPresenter extends StringPresenter
{
@ -40,7 +40,7 @@ public class URLPresenter extends StringPresenter
private long sourceTime;
/**
*
* Instantiates a new URL presenter.
*/
public URLPresenter()
{
@ -49,7 +49,10 @@ public class URLPresenter extends StringPresenter
}
/**
* Instantiates a new URL presenter.
*
* @param source
* the source
*/
public URLPresenter(final String source)
{
@ -58,7 +61,10 @@ public class URLPresenter extends StringPresenter
}
/**
* Instantiates a new URL presenter.
*
* @param source
* the source
*/
public URLPresenter(final URL source)
{
@ -68,6 +74,10 @@ public class URLPresenter extends StringPresenter
/**
* No need to be synchronized.
*
* @return the string buffer
* @throws Exception
* the exception
*/
@Override
public StringBuffer dynamize() throws Exception
@ -86,6 +96,12 @@ public class URLPresenter extends StringPresenter
/**
* No need to be synchronized.
*
* @param data
* the data
* @return the string buffer
* @throws Exception
* the exception
*/
@Override
public StringBuffer dynamize(final TagDataManager data) throws Exception
@ -119,7 +135,9 @@ public class URLPresenter extends StringPresenter
}
/**
* Gets the url.
*
* @return the url
*/
public URL getURL()
{
@ -208,8 +226,8 @@ public class URLPresenter extends StringPresenter
return result;
}
/**
*
/* (non-Javadoc)
* @see fr.devinsy.xidyn.presenters.StringPresenter#setSource(java.lang.String)
*/
@Override
public void setSource(final String source)
@ -263,8 +281,10 @@ public class URLPresenter extends StringPresenter
}
/**
* Sets the source.
*
* @param source
* the new source
*/
public void setSource(final URL source)
{
@ -284,8 +304,8 @@ public class URLPresenter extends StringPresenter
}
}
/**
*
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString()
@ -313,6 +333,7 @@ public class URLPresenter extends StringPresenter
* No need to be synchronized.
*
* @throws Exception
* the exception
*/
@Override
public void update() throws Exception

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -24,11 +24,14 @@ import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXParseException;
/**
* Extract from org.xml.sax Interface ErrorHandler: "If a SAX application needs
* to implement customized error handling, it must implement this interface and
* then register an instance with the XML reader using the setErrorHandler
* method. The parser will then report all errors and warnings through this
* interface."
* The Class ParserErrorHandler.
*
* Extract from org.xml.sax Interface ErrorHandler:
*
* "If a SAX application needs to implement customized error handling, it must
* implement this interface and then register an instance with the XML reader
* using the setErrorHandler method. The parser will then report all errors and
* warnings through this interface."
*
*/
public class ParserErrorHandler implements ErrorHandler
@ -38,6 +41,9 @@ public class ParserErrorHandler implements ErrorHandler
private int errorsCount;
private int warningCount;
/**
* Instantiates a new parser error handler.
*/
public ParserErrorHandler()
{
this.fatalErrorsCount = 0;
@ -47,7 +53,9 @@ public class ParserErrorHandler implements ErrorHandler
}
/**
* All errors count.
*
* @return the int
*/
public int allErrorsCount()
{
@ -62,9 +70,8 @@ public class ParserErrorHandler implements ErrorHandler
/**
* Called by the XML parser to handle fatal errors.
*
* @param ex
* Parse Excpetion. Contains the warning text and the line
* number.
* @param exception
* the exception
*/
@Override
public void error(final SAXParseException exception)
@ -76,7 +83,9 @@ public class ParserErrorHandler implements ErrorHandler
}
/**
* Errors count.
*
* @return the int
*/
public int errorsCount()
{
@ -91,10 +100,8 @@ public class ParserErrorHandler implements ErrorHandler
/**
* Called by the XML parser to handle fatal errors.
*
* @param ex
* Parse Excpetion. Contains the error text and the line number.
* When a fatal parse error occurs, the parse does not return a
* document.
* @param exception
* the exception
*/
@Override
public void fatalError(final SAXParseException exception)
@ -106,7 +113,9 @@ public class ParserErrorHandler implements ErrorHandler
}
/**
* Fatal errors count.
*
* @return the int
*/
public int fatalErrorsCount()
{
@ -119,7 +128,9 @@ public class ParserErrorHandler implements ErrorHandler
}
/**
* Checks for error.
*
* @return true, if successful
*/
public boolean hasError()
{
@ -138,8 +149,8 @@ public class ParserErrorHandler implements ErrorHandler
return result;
}
/**
*
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString()
@ -161,9 +172,8 @@ public class ParserErrorHandler implements ErrorHandler
/**
* Called by the XML parser to handle warnings.
*
* @param ex
* Parse Excpetion. Contains the warning text and the line
* number.
* @param exception
* the exception
*/
@Override
public void warning(final SAXParseException exception)
@ -175,7 +185,9 @@ public class ParserErrorHandler implements ErrorHandler
}
/**
* Warning count.
*
* @return the int
*/
public int warningCount()
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -44,7 +44,7 @@ import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
/**
*
* The Class XidynUtils.
*/
public class XidynUtils
{
@ -53,6 +53,13 @@ public class XidynUtils
/**
* This method adds a tag to a DOM object.
*
* @param doc
* the doc
* @param name
* the name
* @param content
* the content
*/
public static void addMetaTag(final Document doc, final String name, final String content)
{
@ -78,6 +85,12 @@ public class XidynUtils
/**
* This method builds a DOM object from a source.
*
* @param source
* the source
* @return the document
* @throws Exception
* the exception
*/
public static Document buildDom(final InputStream source) throws Exception
{
@ -150,6 +163,12 @@ public class XidynUtils
/**
* This method builds a DOM object from a source.
*
* @param source
* the source
* @return the document
* @throws Exception
* the exception
*/
public static Document buildDom(final String source) throws Exception
{
@ -222,6 +241,10 @@ public class XidynUtils
/**
* Good estimation of the target length able to optimize performance.
*
* @param sourceLength
* the source length
* @return the int
*/
public static int estimatedTargetLength(final long sourceLength)
{
@ -249,7 +272,11 @@ public class XidynUtils
}
/**
* Extract body content.
*
* @param source
* the source
* @return the string
*/
public static String extractBodyContent(final CharSequence source)
{
@ -299,6 +326,7 @@ public class XidynUtils
* </code>
*
* @param source
* the source
* @return the string before the <i>html</i> tag or null if no <i>html</i>
* tag found. So, "" if there is a <i>html</i> tag without doctype.
*/
@ -364,7 +392,13 @@ public class XidynUtils
}
/**
* File to dom.
*
* @param source
* the source
* @return the document
* @throws Exception
* the exception
*/
public static Document fileToDom(final File source) throws Exception
{
@ -408,6 +442,8 @@ public class XidynUtils
*
* @param node
* Document node.
* @param name
* the name
* @return The head tag node
*/
public static Node findNodeByName(final Node node, final String name)
@ -480,10 +516,13 @@ public class XidynUtils
}
/**
* Load.
*
* @param file
* @return
* @param source
* the source
* @return the string
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static String load(final File source) throws IOException
{
@ -497,9 +536,15 @@ public class XidynUtils
}
/**
* Load.
*
* @param file
* @param source
* the source
* @param charsetName
* the charset name
* @return the string
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static String load(final File source, final String charsetName) throws IOException
{
@ -512,10 +557,13 @@ public class XidynUtils
}
/**
* Load.
*
* @param file
* @return
* @param source
* the source
* @return the string
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static String load(final URL source) throws IOException
{
@ -529,9 +577,15 @@ public class XidynUtils
}
/**
* Load.
*
* @param file
* @param source
* the source
* @param charsetName
* the charset name
* @return the string
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static String load(final URL source, final String charsetName) throws IOException
{
@ -549,9 +603,15 @@ public class XidynUtils
}
/**
* Load to string buffer.
*
* @param file
* the file
* @param charsetName
* the charset name
* @return the string buffer
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static StringBuffer loadToStringBuffer(final File file, final String charsetName) throws IOException
{
@ -599,9 +659,16 @@ public class XidynUtils
}
/**
* Read.
*
* @param file
* @param out
* the out
* @param is
* the is
* @param charsetName
* the charset name
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static void read(final StringBuffer out, final InputStream is, final String charsetName) throws IOException
{
@ -701,7 +768,13 @@ public class XidynUtils
}
/**
* Url to dom.
*
* @param source
* the source
* @return the document
* @throws Exception
* the exception
*/
public static Document urlToDom(final URL source) throws Exception
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2016 Christian Pierre MOMON
* Copyright (C) 2016,2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -24,7 +24,10 @@ import java.util.Map;
import fr.devinsy.xidyn.utils.cache.CacheStrategy.Strategy;
/**
* The Class Cache.
*
* @param <T>
* the generic type
*/
public class Cache<T>
{
@ -32,7 +35,7 @@ public class Cache<T>
private Map<Object, CacheItem<T>> map;
/**
*
* Instantiates a new cache.
*/
public Cache()
{
@ -41,7 +44,10 @@ public class Cache<T>
}
/**
* Instantiates a new cache.
*
* @param initialCapacity
* the initial capacity
*/
public Cache(final int initialCapacity)
{
@ -50,7 +56,7 @@ public class Cache<T>
}
/**
*
* Clear.
*/
public void clear()
{
@ -58,10 +64,11 @@ public class Cache<T>
}
/**
* Gets the.
*
* @param key
* @return
* @throws Exception
* the key
* @return the t
*/
public T get(final Object key)
{
@ -83,8 +90,9 @@ public class Cache<T>
}
/**
* Checks if is empty.
*
* @return
* @return true, if is empty
*/
public boolean isEmpty()
{
@ -97,7 +105,7 @@ public class Cache<T>
}
/**
*
* Purge.
*/
public void purge()
{
@ -126,9 +134,13 @@ public class Cache<T>
}
/**
* Put.
*
* @param key
* the key
* @param source
* @return
* the source
* @return the t
*/
public T put(final Object key, final T source)
{
@ -157,8 +169,9 @@ public class Cache<T>
}
/**
* Size.
*
* @return
* @return the int
*/
public int size()
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2016 Christian Pierre MOMON
* Copyright (C) 2016,17 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -21,7 +21,10 @@ package fr.devinsy.xidyn.utils.cache;
import java.util.Date;
/**
* The Class CacheItem.
*
* @param <T>
* the generic type
*/
public class CacheItem<T>
{
@ -31,8 +34,10 @@ public class CacheItem<T>
private long accessDate;
/**
* Instantiates a new cache item.
*
* @param source
* the source
*/
public CacheItem(final T source)
{
@ -43,8 +48,9 @@ public class CacheItem<T>
}
/**
* Access date.
*
* @return
* @return the long
*/
public long accessDate()
{
@ -57,8 +63,9 @@ public class CacheItem<T>
}
/**
* Creation date.
*
* @return
* @return the long
*/
public long creationDate()
{
@ -71,8 +78,9 @@ public class CacheItem<T>
}
/**
* Edition date.
*
* @return
* @return the long
*/
public long editionDate()
{
@ -85,8 +93,9 @@ public class CacheItem<T>
}
/**
* Gets the value.
*
* @return
* @return the value
*/
public T getValue()
{
@ -100,8 +109,10 @@ public class CacheItem<T>
}
/**
* Sets the value.
*
* @param source
* the new value
*/
public void setValue(final T source)
{
@ -110,8 +121,9 @@ public class CacheItem<T>
}
/**
* Time.
*
* @return
* @return the long
*/
private static long time()
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C)2016 Christian Pierre MOMON
/*
* Copyright (C) 2016,2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -19,7 +19,7 @@
package fr.devinsy.xidyn.utils.cache;
/**
*
* The Class CacheStrategy.
*/
public class CacheStrategy
{
@ -34,9 +34,12 @@ public class CacheStrategy
private long parameter;
/**
* Instantiates a new cache strategy.
*
* @param strategy
* the strategy
* @param parameter
* the parameter
*/
public CacheStrategy(final Strategy strategy, final long parameter)
{
@ -55,21 +58,43 @@ public class CacheStrategy
}
}
/**
* Gets the parameter.
*
* @return the parameter
*/
public long getParameter()
{
return this.parameter;
}
/**
* Gets the strategy.
*
* @return the strategy
*/
public Strategy getStrategy()
{
return this.strategy;
}
/**
* Sets the parameter.
*
* @param parameter
* the new parameter
*/
public void setParameter(final long parameter)
{
this.parameter = parameter;
}
/**
* Sets the strategy.
*
* @param strategy
* the new strategy
*/
public void setStrategy(final Strategy strategy)
{
this.strategy = strategy;

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -21,16 +21,22 @@ package fr.devinsy.xidyn.views;
import java.util.Locale;
/**
*
* The Interface CharterView.
*/
public interface CharterView extends View
{
/**
* Gets the html.
*
* @param userId
* @param lang
* the user id
* @param language
* the language
* @param content
* @return
* the content
* @return the html
* @throws Exception
* the exception
*/
public StringBuffer getHtml(final Long userId, final Locale language, final CharSequence content) throws Exception;
}

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -19,12 +19,16 @@
package fr.devinsy.xidyn.views;
/**
*
* The Interface View.
*/
public interface View
{
/**
* Gets the html.
*
* @return the html
* @throws Exception
* the exception
*/
public StringBuffer getHtml() throws Exception;

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2014 Christian Pierre MOMON
/*
* Copyright (C) 2006-2014,2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -21,13 +21,18 @@ import org.w3c.dom.Document;
import fr.devinsy.xidyn.utils.XidynUtils;
/**
*
* The Class Foo.
*/
class Foo
public class Foo
{
/**
* @throws Exception
* The main method.
*
* @param args
* the arguments
* @throws Exception
* the exception
*/
public static void main(final String[] args) throws Exception
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -25,7 +25,7 @@ import fr.devinsy.xidyn.data.TagDataManager;
import fr.devinsy.xidyn.presenters.PresenterUtils;
/**
*
* The Class XidynTest.
*/
class XidynTest
{
@ -46,6 +46,7 @@ class XidynTest
}
private static Logger logger = LoggerFactory.getLogger(XidynTest.class);
static
{
// Initialize logger.
@ -54,7 +55,15 @@ class XidynTest
}
/**
* Check.
*
* @param title
* the title
* @param source
* the source
* @param model
* the model
* @return the string
*/
public static String check(final String title, final StringBuffer source, final String model)
{
@ -75,7 +84,10 @@ class XidynTest
};
/**
* The main method.
*
* @param args
* the arguments
*/
public static void main(final String[] args)
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2016 Christian Pierre MOMON
/*
* Copyright (C) 2016,2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -26,12 +26,12 @@ import org.junit.Before;
import org.junit.Test;
/**
*
* The Class PageFactoryTest.
*/
public class PageFactoryTest
{
/**
*
* Before.
*/
@Before
public void before()
@ -41,8 +41,10 @@ public class PageFactoryTest
}
/**
* @throws Exception
* Test page 01.
*
* @throws Exception
* the exception
*/
@Test(expected = IllegalArgumentException.class)
public void testPage01() throws Exception
@ -55,8 +57,10 @@ public class PageFactoryTest
}
/**
* @throws Exception
* Test page 02.
*
* @throws Exception
* the exception
*/
@Test
public void testPage02() throws Exception

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2016 Christian Pierre MOMON
/*
* Copyright (C) 2016,2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -28,12 +28,12 @@ import org.junit.Test;
import fr.devinsy.xidyn.presenters.StringPresenter;
/**
*
* The Class PageTest.
*/
public class PageTest
{
/**
*
* Before.
*/
@Before
public void before()
@ -43,8 +43,10 @@ public class PageTest
}
/**
* @throws Exception
* Test page 01.
*
* @throws Exception
* the exception
*/
@Test
public void testPage01() throws Exception

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -24,14 +24,15 @@ import org.junit.Test;
import fr.devinsy.xidyn.data.TagDataManager;
/**
*
* The Class DomPresenterTest.
*/
public class DomPresenterTest
{
/**
* @throws Exception
* Test static dynamize 01.
*
* @throws Exception
* the exception
*/
@Test
public void testStaticDynamize01() throws Exception
@ -44,8 +45,10 @@ public class DomPresenterTest
}
/**
* @throws Exception
* Test static dynamize 02.
*
* @throws Exception
* the exception
*/
@Test
public void testStaticDynamize02() throws Exception
@ -56,5 +59,4 @@ public class DomPresenterTest
Assertions.assertThat(target).isEqualTo(source);
}
}

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -28,12 +28,12 @@ import org.junit.Test;
import fr.devinsy.xidyn.data.TagDataManager;
/**
*
* The Class PresenterUtilsTest.
*/
public class PresenterUtilsTest
{
/**
*
* Before.
*/
@Before
public void before()
@ -43,8 +43,10 @@ public class PresenterUtilsTest
}
/**
* @throws Exception
* Test static dynamize 01.
*
* @throws Exception
* the exception
*/
@Test
public void testStaticDynamize01() throws Exception
@ -57,8 +59,10 @@ public class PresenterUtilsTest
}
/**
* @throws Exception
* Test static dynamize 02.
*
* @throws Exception
* the exception
*/
@Test
public void testStaticDynamize02() throws Exception
@ -69,5 +73,4 @@ public class PresenterUtilsTest
Assertions.assertThat(target).isEqualTo(source);
}
}

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -28,12 +28,12 @@ import org.junit.Test;
import fr.devinsy.xidyn.data.TagDataManager;
/**
*
* The Class StringPresenterTest.
*/
public class StringPresenterTest
{
/**
*
* Before.
*/
@Before
public void before()
@ -43,8 +43,10 @@ public class StringPresenterTest
}
/**
* @throws Exception
* Test dynamize 01.
*
* @throws Exception
* the exception
*/
@Test
public void testDynamize01() throws Exception
@ -57,8 +59,10 @@ public class StringPresenterTest
}
/**
* @throws Exception
* Test dynamize 02.
*
* @throws Exception
* the exception
*/
@Test
public void testDynamize02() throws Exception
@ -71,8 +75,10 @@ public class StringPresenterTest
}
/**
* @throws Exception
* Test dynamize 03.
*
* @throws Exception
* the exception
*/
@Test
public void testDynamize03() throws Exception

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2016 Christian Pierre MOMON
/*
* Copyright (C) 2006-2017 Christian Pierre MOMON
*
* This file is part of Xidyn.
*
@ -26,12 +26,12 @@ import org.junit.Before;
import org.junit.Test;
/**
*
* The Class XidynUtilsTest.
*/
public class XidynUtilsTest
{
/**
*
* Before.
*/
@Before
public void before()
@ -41,7 +41,7 @@ public class XidynUtilsTest
}
/**
*
* Test extract body content 01.
*/
@Test
public void testExtractBodyContent01()
@ -53,7 +53,7 @@ public class XidynUtilsTest
}
/**
*
* Test extract body content 02.
*/
@Test
public void testExtractBodyContent02()
@ -65,7 +65,7 @@ public class XidynUtilsTest
}
/**
*
* Test extract body content 03.
*/
@Test
public void testExtractBodyContent03()
@ -77,7 +77,7 @@ public class XidynUtilsTest
}
/**
*
* Test extract body content 04.
*/
@Test
public void testExtractBodyContent04()
@ -89,7 +89,7 @@ public class XidynUtilsTest
}
/**
*
* Test extract body content 05.
*/
@Test
public void testExtractBodyContent05()
@ -118,7 +118,7 @@ public class XidynUtilsTest
}
/**
*
* Test extract doctype 01.
*/
@Test
public void testExtractDoctype01()
@ -130,7 +130,7 @@ public class XidynUtilsTest
}
/**
*
* Test extract doctype 02.
*/
@Test
public void testExtractDoctype02()
@ -142,7 +142,7 @@ public class XidynUtilsTest
}
/**
*
* Test extract doctype 03.
*/
@Test
public void testExtractDoctype03()
@ -154,7 +154,7 @@ public class XidynUtilsTest
}
/**
*
* Test extract doctype 04.
*/
@Test
public void testExtractDoctype04()
@ -166,7 +166,7 @@ public class XidynUtilsTest
}
/**
*
* Test extract doctype 05.
*/
@Test
public void testExtractDoctype05()
@ -176,5 +176,4 @@ public class XidynUtilsTest
String target = XidynUtils.extractDoctype(source);
Assertions.assertThat(target).isEqualTo("<?xml version='1.0' encoding='UTF-8' ?><!-- TOTOT --><!DOCTYPE html>");
}
}