Normalized code.

This commit is contained in:
Christian P. MOMON 2017-05-05 20:11:59 +02:00
parent 53953db75c
commit 191748bac9
15 changed files with 88 additions and 61 deletions

View file

@ -112,7 +112,7 @@ public class SimpleTagData implements Serializable, TagData
result = this.attributes; result = this.attributes;
// //
return (result); return result;
} }
/** /**
@ -125,7 +125,7 @@ public class SimpleTagData implements Serializable, TagData
result = this.content; result = this.content;
// //
return (result); return result;
} }
/** /**
@ -137,7 +137,7 @@ public class SimpleTagData implements Serializable, TagData
result = this.displayMode; result = this.displayMode;
return (result); return result;
} }
/** /**
@ -150,7 +150,7 @@ public class SimpleTagData implements Serializable, TagData
result = this.excludeSection; result = this.excludeSection;
// //
return (result); return result;
} }
/** /**
@ -163,7 +163,7 @@ public class SimpleTagData implements Serializable, TagData
result = this.iterationStrategy; result = this.iterationStrategy;
// //
return (result); return result;
} }
/** /**

View file

@ -54,7 +54,7 @@ public class TagAttributes extends HashMap<String, String>
{ {
if (this.containsKey(label)) if (this.containsKey(label))
{ {
this.put(label, this.get(label) + value); this.put(label, this.get(label) + " " + value);
} }
else else
{ {
@ -79,7 +79,7 @@ public class TagAttributes extends HashMap<String, String>
} }
// //
return (result); return result;
} }
/** /**

View file

@ -46,7 +46,7 @@ public class TagDataListById extends HashMap<String, TagData> implements TagData
result = this.get(id); result = this.get(id);
// //
return (result); return result;
} }
/** /**

View file

@ -18,6 +18,8 @@
*/ */
package fr.devinsy.xidyn.data; package fr.devinsy.xidyn.data;
import fr.devinsy.xidyn.presenters.DomPresenterCore;
/** /**
* *
* @author Christian Pierre MOMON (christian.momon@devinsy.fr) * @author Christian Pierre MOMON (christian.momon@devinsy.fr)
@ -250,6 +252,21 @@ public class TagDataManager
/** /**
* *
* @param id
*/
public void removeTag(final String id)
{
SimpleTagData tag = this.getIdData(id);
tag.attributes().setAttribute("class", DomPresenterCore.NODISPLAY_CLASS);
}
/**
*
* @param id
* @param line
* @param label
* @param value
*/ */
public void setAttribute(final String id, final int line, final String label, final long value) public void setAttribute(final String id, final int line, final String label, final long value)
{ {
@ -258,6 +275,10 @@ public class TagDataManager
/** /**
* *
* @param id
* @param line
* @param label
* @param value
*/ */
public void setAttribute(final String id, final int line, final String label, final String value) public void setAttribute(final String id, final int line, final String label, final String value)
{ {
@ -268,6 +289,11 @@ public class TagDataManager
/** /**
* *
* @param id
* @param line
* @param column
* @param label
* @param value
*/ */
public void setAttribute(final String id, final int line, final String column, final String label, final long value) public void setAttribute(final String id, final int line, final String column, final String label, final long value)
{ {

View file

@ -103,7 +103,7 @@ public class DomPresenter implements Presenter
} }
// //
return (result); return result;
} }
/** /**
@ -116,7 +116,7 @@ public class DomPresenter implements Presenter
result = this.dom; result = this.dom;
// //
return (result); return result;
} }
/** /**
@ -130,7 +130,7 @@ public class DomPresenter implements Presenter
result = this.dom; result = this.dom;
// //
return (result); return result;
} }
/** /**

View file

@ -49,6 +49,7 @@ public class DomPresenterCore
private static Logger logger = LoggerFactory.getLogger(DomPresenterCore.class); private static Logger logger = LoggerFactory.getLogger(DomPresenterCore.class);
public static final char INDEX_SEPARATOR = '_'; public static final char INDEX_SEPARATOR = '_';
public static final String NODISPLAY_CLASS = "xid:nodisplay";
/** /**
* Dynamize a doc with data. * Dynamize a doc with data.
@ -62,7 +63,7 @@ public class DomPresenterCore
result = htmlCode.getBuffer(); result = htmlCode.getBuffer();
// //
return (result); return result;
} }
/** /**
@ -75,7 +76,7 @@ public class DomPresenterCore
result = dynamize(doc, data.getIdsDataById()); result = dynamize(doc, data.getIdsDataById());
// //
return (result); return result;
} }
/** /**
@ -121,7 +122,7 @@ public class DomPresenterCore
} }
// //
return (result); return result;
} }
/** /**
@ -169,7 +170,7 @@ public class DomPresenterCore
} }
// //
return (result); return result;
} }
/** /**
@ -216,7 +217,7 @@ public class DomPresenterCore
} }
// //
return (result); return result;
} }
/** /**
@ -269,7 +270,7 @@ public class DomPresenterCore
String name; String name;
name = getClassAttributeValue(node); name = getClassAttributeValue(node);
if ((name == null) || ((name != null) && (!name.equals("xid:nodisplay")))) if ((name == null) || ((name != null) && (!name.equals(NODISPLAY_CLASS))))
{ {
int type = node.getNodeType(); int type = node.getNodeType();
switch (type) switch (type)
@ -383,7 +384,7 @@ public class DomPresenterCore
result = processAttributes(attrs, null, null, ""); result = processAttributes(attrs, null, null, "");
// //
return (result); return result;
} }
/** /**
@ -396,7 +397,7 @@ public class DomPresenterCore
result = processAttributes(attrs, dataAttributes, ""); result = processAttributes(attrs, dataAttributes, "");
// //
return (result); return result;
} }
/** /**
@ -461,7 +462,7 @@ public class DomPresenterCore
} }
// //
return (result); return result;
} }
/** /**
@ -474,7 +475,7 @@ public class DomPresenterCore
result = processAttributes(attrs, mergeAttributes(dataAttributes, namedDataAttributes), suffix); result = processAttributes(attrs, mergeAttributes(dataAttributes, namedDataAttributes), suffix);
// //
return (result); return result;
} }
/** /**
@ -708,7 +709,7 @@ public class DomPresenterCore
String theClass = data.attributes().getAttribute("class"); String theClass = data.attributes().getAttribute("class");
if ((theClass == null) || (!theClass.equals("xid:nodisplay"))) if ((theClass == null) || (!theClass.equals(NODISPLAY_CLASS)))
{ {
// Open the tag. // Open the tag.
result.append("<"); result.append("<");

View file

@ -100,7 +100,7 @@ public class FilePresenter extends StringPresenter
result = super.dynamize(data); result = super.dynamize(data);
// //
return (result); return result;
} }
/** /**
@ -113,7 +113,7 @@ public class FilePresenter extends StringPresenter
result = this.source; result = this.source;
// //
return (result); return result;
} }
/** /**
@ -127,7 +127,7 @@ public class FilePresenter extends StringPresenter
result = this.sourceFilePathname; result = this.sourceFilePathname;
// //
return (result); return result;
} }
/** /**

View file

@ -68,7 +68,7 @@ public class FilePresenters extends Vector<FilePresenter>
} }
// //
return (result); return result;
} }
/** /**
@ -81,7 +81,7 @@ public class FilePresenters extends Vector<FilePresenter>
result = this.get(id); result = this.get(id);
// //
return (result); return result;
} }
/** /**
@ -125,7 +125,7 @@ public class FilePresenters extends Vector<FilePresenter>
} }
// //
return (result); return result;
} }
/** /**
@ -169,7 +169,7 @@ public class FilePresenters extends Vector<FilePresenter>
} }
// //
return (result); return result;
} }
/** /**
@ -183,7 +183,7 @@ public class FilePresenters extends Vector<FilePresenter>
result = ""; result = "";
// //
return (result); return result;
} }
} }

View file

@ -61,7 +61,7 @@ public class FilePresentersProxy
} }
// //
return (result); return result;
} }
/** /**
@ -79,7 +79,7 @@ public class FilePresentersProxy
result = instance; result = instance;
// //
return (result); return result;
} }
} }

View file

@ -87,7 +87,7 @@ public class PresenterUtils
result = presenter.dynamize((TagDataManager) null); result = presenter.dynamize((TagDataManager) null);
// //
return (result); return result;
} }
/** /**
@ -102,7 +102,7 @@ public class PresenterUtils
result = presenter.dynamize(datas); result = presenter.dynamize(datas);
// //
return (result); return result;
} }
/** /**
@ -118,7 +118,7 @@ public class PresenterUtils
result = presenter.dynamize(datas); result = presenter.dynamize(datas);
// //
return (result); return result;
} }
/** /**

View file

@ -155,7 +155,7 @@ public class StringPresenter implements Presenter
} }
// //
return (result); return result;
} }
/** /**
@ -169,7 +169,7 @@ public class StringPresenter implements Presenter
result = this.source; result = this.source;
// //
return (result); return result;
} }
/** /**

View file

@ -101,7 +101,7 @@ public class URLPresenter extends StringPresenter
result = super.dynamize(data); result = super.dynamize(data);
// //
return (result); return result;
} }
/** /**
@ -115,7 +115,7 @@ public class URLPresenter extends StringPresenter
result = this.sourcePathname; result = this.sourcePathname;
// //
return (result); return result;
} }
/** /**
@ -128,7 +128,7 @@ public class URLPresenter extends StringPresenter
result = this.source; result = this.source;
// //
return (result); return result;
} }
/** /**

View file

@ -56,7 +56,7 @@ public class ParserErrorHandler implements ErrorHandler
result = fatalErrorsCount() + errorsCount() + warningCount(); result = fatalErrorsCount() + errorsCount() + warningCount();
// //
return (result); return result;
} }
/** /**
@ -85,7 +85,7 @@ public class ParserErrorHandler implements ErrorHandler
result = this.errorsCount; result = this.errorsCount;
// //
return (result); return result;
} }
/** /**
@ -115,7 +115,7 @@ public class ParserErrorHandler implements ErrorHandler
result = this.fatalErrorsCount; result = this.fatalErrorsCount;
// //
return (result); return result;
} }
/** /**
@ -135,7 +135,7 @@ public class ParserErrorHandler implements ErrorHandler
} }
// //
return (result); return result;
} }
/** /**
@ -184,6 +184,6 @@ public class ParserErrorHandler implements ErrorHandler
result = this.warningCount; result = this.warningCount;
// //
return (result); return result;
} }
} }

View file

@ -145,7 +145,7 @@ public class XidynUtils
} }
// //
return (result); return result;
} }
/** /**
@ -217,7 +217,7 @@ public class XidynUtils
} }
// //
return (result); return result;
} }
/** /**
@ -245,7 +245,7 @@ public class XidynUtils
} }
// //
return (result); return result;
} }
/** /**
@ -278,7 +278,7 @@ public class XidynUtils
} }
// //
return (result); return result;
} }
/** /**
@ -383,7 +383,7 @@ public class XidynUtils
} }
// //
return (result); return result;
} }
/** /**
@ -697,7 +697,7 @@ public class XidynUtils
} }
// //
return (result); return result;
} }
/** /**
@ -720,6 +720,6 @@ public class XidynUtils
} }
// //
return (result); return result;
} }
} }

View file

@ -71,7 +71,7 @@ class XidynTest
} }
// //
return (result); return result;
}; };
/** /**