Class XmlGenerationUtil
java.lang.Object
com.aquima.interactions.foundation.ds.XmlGenerationUtil
Utility class for creating XML elements of datasource objects.
- Since:
- 7.1
- Author:
- Jon van Leuven
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
setAttribute
(IXmlElement node, String attributeName, boolean booleanValue) Set the node's attribute value with a boolean.static void
setAttribute
(IXmlElement node, String attributeName, int intValue) Set the node's attribute value with an int.static void
setAttribute
(IXmlElement node, String attributeName, BooleanValue booleanValue) Set the node's attribute value with a boolean value.static void
setAttribute
(IXmlElement node, String attributeName, String stringValue) Set the node's attribute value when stringValue not is null.static void
writeDescription
(IXmlWriter writer, String description) Writes a description CData elementstatic void
writeDocumentation
(IXmlWriter writer, String documentation) Writes a documentation CData elementstatic void
writeExpression
(IXmlWriter writer, String nodeName, String expression) Writes an element with a CData element containing the expressionstatic void
writeMultilingualXmlElement
(IXmlWriter writer, IPrimitiveValue domainValue, String[] languageCodes) Utility method to create a multilingual xml fragment for a value (with display value).static void
writeMultilingualXmlElement
(IXmlWriter writer, IMultilingualText displayValue, String[] languageCodes) Utility method to create a multilingual xml fragment for a with display value.static void
writeValueElement
(IXmlWriter writer, String nodeName, IValue value) Utility method to create an IValue xml fragment for a value.
-
Method Details
-
setAttribute
Set the node's attribute value when stringValue not is null.- Parameters:
node
- The target node.attributeName
- The name of the attribute.stringValue
- The value of the attribute, may be null.
-
setAttribute
Set the node's attribute value with a boolean. When the boolean is false no attribute is added!- Parameters:
node
- The target node.attributeName
- The name of the attribute.booleanValue
- The value of the attribute.
-
setAttribute
Set the node's attribute value with a boolean value. When the boolean is null or unknown no attribute is added!- Parameters:
node
- The target node.attributeName
- The name of the attribute.booleanValue
- The value of the attribute.
-
setAttribute
Set the node's attribute value with an int.- Parameters:
node
- The target node.attributeName
- The name of the attribute.intValue
- The value of the attribute.
-
writeValueElement
public static void writeValueElement(IXmlWriter writer, String nodeName, IValue value) throws IOException Utility method to create an IValue xml fragment for a value.- Parameters:
writer
- The destination xml writer.nodeName
- the name of the node in which the IValue is savedvalue
- the value, not null.- Throws:
IOException
- Is thrown when the xml could not be written
-
writeMultilingualXmlElement
public static void writeMultilingualXmlElement(IXmlWriter writer, IPrimitiveValue domainValue, String[] languageCodes) throws IOException Utility method to create a multilingual xml fragment for a value (with display value).- Parameters:
writer
- The destination xml writer.domainValue
- The value (with optional display value)languageCodes
- All the languageCodes that should be rendered to xml.- Throws:
IOException
- Is thrown when the xml could not be written
-
writeMultilingualXmlElement
public static void writeMultilingualXmlElement(IXmlWriter writer, IMultilingualText displayValue, String[] languageCodes) throws IOException Utility method to create a multilingual xml fragment for a with display value.- Parameters:
writer
- The destination xml writer.displayValue
- The value (with optional display value)languageCodes
- All the languages that should be rendered to xml.- Throws:
IOException
- Is thrown when the xml could not be written
-
writeDocumentation
Writes a documentation CData element- Parameters:
writer
- The destination xml writerdocumentation
- The documentation contents to write- Throws:
IOException
- Is thrown when the xml could not be written
-
writeExpression
public static void writeExpression(IXmlWriter writer, String nodeName, String expression) throws IOException Writes an element with a CData element containing the expression- Parameters:
writer
- The destination xml writer.nodeName
- the name of the node in which the expression is savedexpression
- the expression, not null.- Throws:
IOException
- Is thrown when the xml could not be written
-
writeDescription
Writes a description CData element- Parameters:
writer
- The destination xml writerdescription
- The description contents to write- Throws:
IOException
- Is thrown when the xml could not be written
-