51Degrees Pipeline Java  4.1

51Degrees Pipeline for Java
  • fiftyone
  • pipeline
  • engines
  • fiftyone
  • flowelements
  • XmlBuilder

fiftyone.pipeline.engines.fiftyone.flowelements.XmlBuilder Class Reference

Detailed Description

Builder used to construct an XML string.

Public Member Functions

 XmlBuilder ()
Default constructor.
String  toString ()
Build the XML string. More...
void  writeStartElement (String key)
Write an XML element which starts a block i.e <key>. More...
void  writeEndElement (String key)
Write an XML element which ends a block i.e. More...
void  writeStartElement (String key, Map.Entry< String, String > attribute)
Write an XML element which starts a block with an attribute defined i.e. More...
void  writeStartElement (String key, List< Map.Entry< String, String >> attributes)
Write an XML element which starts a block with the attributes defined i.e. More...
void  writeCData (String value)
Write data in a CDATA block. More...
void  writeElement (String key, String value)
Write a value surrounded by a start and end element. More...

Static Public Member Functions

static boolean  verifyXmlChars (String s)
Verify that there are no invalid characters in the string. More...
static String  escapeUnicode (char c)
Get the escaped unicode for a character which cannot be printed in an XML string. More...
static boolean  isValidChar (char c)
Check if the character is valid. More...

Static Public Attributes

static final String  XML_HEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
Header to add to an XML string.

Member Function Documentation

◆ escapeUnicode()

static String fiftyone.pipeline.engines.fiftyone.flowelements.XmlBuilder.escapeUnicode ( char   c )
static

Get the escaped unicode for a character which cannot be printed in an XML string.

Parameters
c - character top escape
Returns
escaped unicode

◆ isValidChar()

static boolean fiftyone.pipeline.engines.fiftyone.flowelements.XmlBuilder.isValidChar ( char   c )
static

Check if the character is valid.

Parameters
c - character to check
Returns
true if the character is valid

◆ toString()

String fiftyone.pipeline.engines.fiftyone.flowelements.XmlBuilder.toString ( )

Build the XML string.

Returns
XML string

◆ verifyXmlChars()

static boolean fiftyone.pipeline.engines.fiftyone.flowelements.XmlBuilder.verifyXmlChars ( String   s )
static

Verify that there are no invalid characters in the string.

Parameters
s - string to check
Returns
true if there are no invalid characters

◆ writeCData()

void fiftyone.pipeline.engines.fiftyone.flowelements.XmlBuilder.writeCData ( String   value )

Write data in a CDATA block.

Parameters
value - value to write in the block

◆ writeElement()

void fiftyone.pipeline.engines.fiftyone.flowelements.XmlBuilder.writeElement ( String   key,
String   value  
)

Write a value surrounded by a start and end element.

Parameters
key - name of the element
value - the value

◆ writeEndElement()

void fiftyone.pipeline.engines.fiftyone.flowelements.XmlBuilder.writeEndElement ( String   key )

Write an XML element which ends a block i.e.

</key>.

Parameters
key - name of the element

◆ writeStartElement() [1/3]

void fiftyone.pipeline.engines.fiftyone.flowelements.XmlBuilder.writeStartElement ( String   key )

Write an XML element which starts a block i.e <key>.

Parameters
key - name of the element

◆ writeStartElement() [2/3]

void fiftyone.pipeline.engines.fiftyone.flowelements.XmlBuilder.writeStartElement ( String   key,
Map.Entry< String, String >   attribute  
)

Write an XML element which starts a block with an attribute defined i.e.

<key attribute="value">.

Parameters
key - name of the element
attribute - the attribute and value

◆ writeStartElement() [3/3]

void fiftyone.pipeline.engines.fiftyone.flowelements.XmlBuilder.writeStartElement ( String   key,
List< Map.Entry< String, String >>   attributes  
)

Write an XML element which starts a block with the attributes defined i.e.

<key attribute1="value1" attribute2="value2">.

Parameters
key - name of the element
attributes - the attributes and their values