Added setEscapedAttribute methods. Refactored setEscapedContent methods.

This commit is contained in:
Christian P. MOMON 2020-11-20 05:17:41 +01:00
parent 900f402000
commit 2637f4e2c8
2 changed files with 85 additions and 4 deletions

View file

@ -21,6 +21,7 @@ package fr.devinsy.xidyn.data;
import java.io.Serializable; import java.io.Serializable;
import fr.devinsy.strings.StringsUtils; import fr.devinsy.strings.StringsUtils;
import fr.devinsy.xidyn.utils.XidynUtils;
/** /**
* The Class SimpleTagData. * The Class SimpleTagData.
@ -344,6 +345,30 @@ public class SimpleTagData implements Serializable, TagData
this.displayMode = displayMode; this.displayMode = displayMode;
} }
/**
* Sets the escaped attribute.
*
* @param label
* the label
* @param value
* the value
*/
public void setEscapedAttribute(final String label, final String value)
{
setAttribute(label, XidynUtils.escapeXmlBlank(value));
}
/**
* Sets the escaped content.
*
* @param text
* the new escaped content
*/
public void setEscapedContent(final String text)
{
setContent(XidynUtils.escapeXmlBlank(text));
}
/** /**
* Sets the exclude section. * Sets the exclude section.
* *

View file

@ -19,7 +19,6 @@
package fr.devinsy.xidyn.data; package fr.devinsy.xidyn.data;
import fr.devinsy.xidyn.presenters.DomPresenterCore; import fr.devinsy.xidyn.presenters.DomPresenterCore;
import fr.devinsy.xidyn.utils.XidynUtils;
/** /**
* The Class TagDataManager. * The Class TagDataManager.
@ -660,6 +659,63 @@ public class TagDataManager
idData.setContent(content); idData.setContent(content);
} }
/**
* Sets the escaped attribute.
*
* @param id
* the id
* @param line
* the line
* @param label
* the label
* @param value
* the value
*/
public void setEscapedAttribute(final String id, final int line, final String label, final String value)
{
SimpleTagData tag = this.getIdData(id, line);
tag.setEscapedAttribute(label, value);
}
/**
* Sets the escaped attribute.
*
* @param id
* the id
* @param line
* the line
* @param column
* the column
* @param label
* the label
* @param value
* the value
*/
public void setEscapedAttribute(final String id, final int line, final String column, final String label, final String value)
{
SimpleTagData tag = this.getIdData(id, line, column);
tag.setEscapedAttribute(label, value);
}
/**
* Sets the escaped attribute.
*
* @param id
* the id
* @param label
* the label
* @param value
* the value
*/
public void setEscapedAttribute(final String id, final String label, final String value)
{
SimpleTagData tag = this.getIdData(id);
tag.setEscapedAttribute(label, value);
}
/** /**
* Sets the escaped content. * Sets the escaped content.
* *
@ -674,7 +730,7 @@ public class TagDataManager
{ {
SimpleTagData tag = this.getIdData(id, line); SimpleTagData tag = this.getIdData(id, line);
tag.setContent(XidynUtils.escapeXmlBlank(content)); tag.setEscapedContent(content);
} }
/** /**
@ -693,7 +749,7 @@ public class TagDataManager
{ {
SimpleTagData tag = this.getIdData(id, line, column); SimpleTagData tag = this.getIdData(id, line, column);
tag.setContent(XidynUtils.escapeXmlBlank(content)); tag.setEscapedContent(content);
} }
/** /**
@ -708,7 +764,7 @@ public class TagDataManager
{ {
SimpleTagData idData = this.getIdData(id); SimpleTagData idData = this.getIdData(id);
idData.setContent(XidynUtils.escapeXmlBlank(content)); idData.setEscapedContent(content);
} }
/** /**