Class XMLBuilderUtils

java.lang.Object
com.appiancorp.suiteapi.process.XMLBuilderUtils

public class XMLBuilderUtils extends Object
Class provides utility methods to create an XML document
  • Constructor Details

    • XMLBuilderUtils

      public XMLBuilderUtils()
  • Method Details

    • addCData

      public static void addCData(StringBuffer buffer_, String value_)
      Encloses an item in CDATA tags
      Parameters:
      buffer_ - buffer to add to
      value_ - 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 to
      element_ - element to add
      body_ - body of element
      cData_ - whether or not the element is CDATA. If it is, then it will be enclosed in CDATA tags using addCData(java.lang.StringBuffer, java.lang.String)
    • addAttribute

      public static void addAttribute(StringBuffer buffer_, String attr_, String value_, boolean escape_)
      Adds an XML attribute to a buffer
      Parameters:
      buffer_ - buffer to add xml element to
      attr_ - the attribute name
      value_ - attribute value
      escape_ - whether or not the element should be escaped to HTML (follows the same rules as appendAsHtmlString)
    • appendAsHtmlString

      public static void appendAsHtmlString(StringBuffer buffer_, char[] text_)
      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 to
      text_ - plain text version of the text to add
    • appendAsHtmlString

      public static void appendAsHtmlString(StringBuffer buffer_, String text_)
      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 to
      text_ - plain text version of the text to add
      See Also:
    • appendAsHtmlString

      public static void appendAsHtmlString(StringBuffer buffer_, StringBuffer text_)
      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 to
      text_ - plain text version of the text to add
      See Also: