Package com.appiancorp.suiteapi.process
Class XMLBuilderUtils
java.lang.Object
com.appiancorp.suiteapi.process.XMLBuilderUtils
Class provides utility methods to create an XML document
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addAttribute
(StringBuffer buffer_, String attr_, String value_, boolean escape_) Adds an XML attribute to a bufferstatic void
addCData
(StringBuffer buffer_, String value_) Encloses an item in CDATA tagsstatic void
addSimpleElement
(StringBuffer buffer_, String element_, String body_, boolean cData_) Adds a simple XML element to a bufferstatic void
appendAsHtmlString
(StringBuffer buffer_, char[] text_) Appends the plain text as an HTML string, escaping reserved characters and replacing \n with
along the waystatic void
appendAsHtmlString
(StringBuffer buffer_, String text_) Appends the plain text as an HTML string, escaping reserved characters and replacing \n with
along the waystatic void
appendAsHtmlString
(StringBuffer buffer_, StringBuffer text_) Appends the plain text as an HTML string, escaping reserved characters and replacing \n with
along the way
-
Constructor Details
-
XMLBuilderUtils
public XMLBuilderUtils()
-
-
Method Details
-
addCData
Encloses an item in CDATA tags- Parameters:
buffer_
- buffer to add tovalue_
- value to enclose in CDATA tags
-
addSimpleElement
public static void addSimpleElement(StringBuffer buffer_, String element_, String body_, boolean cData_) Adds a simple XML element to a buffer- Parameters:
buffer_
- buffer to add xml element toelement_
- element to addbody_
- body of elementcData_
- whether or not the element is CDATA. If it is, then it will be enclosed in CDATA tags usingaddCData(java.lang.StringBuffer, java.lang.String)
-
addAttribute
Adds an XML attribute to a buffer- Parameters:
buffer_
- buffer to add xml element toattr_
- the attribute namevalue_
- attribute valueescape_
- whether or not the element should be escaped to HTML (follows the same rules as appendAsHtmlString)
-
appendAsHtmlString
Appends the plain text as an HTML string, escaping reserved characters and replacing \n with
along the way- Parameters:
buffer_
- buffer to append the HTML data totext_
- plain text version of the text to add
-
appendAsHtmlString
Appends the plain text as an HTML string, escaping reserved characters and replacing \n with
along the way- Parameters:
buffer_
- buffer to append the HTML data totext_
- plain text version of the text to add- See Also:
-
appendAsHtmlString
Appends the plain text as an HTML string, escaping reserved characters and replacing \n with
along the way- Parameters:
buffer_
- buffer to append the HTML data totext_
- plain text version of the text to add- See Also:
-