Package com.ibm.di.connector.maximo.util
Class XmlBuilder
- java.lang.Object
-
- com.ibm.di.connector.maximo.util.XmlBuilder
-
public final class XmlBuilder extends java.lang.Object
Simple XML content generator.This class contains simple methods to create XML content.
Note: no XML validation is made.
- Since:
- 7.1
-
-
Constructor Summary
Constructors Constructor Description XmlBuilder(java.lang.String rootName)
Constructs a newXmlBuilder
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setAttribute(java.lang.String fullName, java.lang.String value)
Defines an XML attribute and its value.void
tag(java.lang.String fullName, java.lang.String value)
Defines an XML tag and its content (without CDATA block).void
tag(java.lang.String fullName, java.lang.String value, boolean cdata)
Defines an XML tag and its content.java.lang.String
toString()
Returns the XML content asString
.
-
-
-
Constructor Detail
-
XmlBuilder
public XmlBuilder(java.lang.String rootName)
Constructs a newXmlBuilder
.- Parameters:
rootName
- name of the root node
-
-
Method Detail
-
setAttribute
public void setAttribute(java.lang.String fullName, java.lang.String value)
Defines an XML attribute and its value.The
fullName
parameter must comply the following syntax:<code> <root node>@<child node 1>@<child node 2>@<child node N>#<new attribute> </code>
- Parameters:
fullName
- the complete path from the root node until the attribute namevalue
- the attribute's value
-
tag
public void tag(java.lang.String fullName, java.lang.String value)
Defines an XML tag and its content (without CDATA block).- Parameters:
fullName
- the complete path from the root node until the tag namevalue
- the tag's content- See Also:
tag(String, String, boolean)
-
tag
public void tag(java.lang.String fullName, java.lang.String value, boolean cdata)
Defines an XML tag and its content.The
fullName
parameter must comply the following syntax:<code> <root node>@<child node 1>@<child node 2>@<child node N>@<new tag> </code>
- Parameters:
fullName
- the complete path from the root node until the tag namevalue
- the tag's contentcdata
-true
ifvalue
must be enclosed by a CDATA block, otherwisefalse
-
toString
public java.lang.String toString()
Returns the XML content asString
.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the XML content as
String
-
-