Top Description Fields Constructors Methods
org.testng.reporters

public final Class XMLUtils

extends Object
Class Inheritance
Imports
java.text.CharacterIterator, .StringCharacterIterator, java.util.Map.Entry, .Optional, .Properties, javax.annotation.Nullable

Static helpers for XML.
Author
Cedric Beust Jul 21, 2003

Field Summary

Modifier and TypeField and Description
private static final String
EOL

Platform specific end of line

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
appendAttributes(IBuffer
the buffer to append attributes to.
result
,
Properties
the attributes to append (may be null).
attributes
)

Appends the attributes to result.

public static String
escape(String input)

public static String
extractComment(String tag, Properties properties)

public static String

Returns:

The String value of the generated tag
xml
(String
indent
indent
,
String
name of the tag
name
,
String
content for this tag (or null)
content
,
Properties
tag attributes (or null)
attributes
)

Generate tag.

public static void
xmlClose(IBuffer result, String indent, String tag, String comment)

public static void
xmlOpen(IBuffer result, String indent, String tag, Properties attributes)

public static void
xmlOpen(IBuffer result, String indent, String tag, Properties attributes, boolean noNewLine)

public static void
xmlOptional(IBuffer result, String sp, String elementName, Boolean value, Properties attributes)

public static void
xmlOptional(IBuffer result, String sp, String elementName, String value, Properties attributes)

public static void
xmlRequired(IBuffer result, String sp, String elementName, String value, Properties attributes)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EOLback to summary
private static final String EOL

Platform specific end of line

Constructor Detail

XMLUtilsback to summary
private XMLUtils()

Method Detail

appendAttributesback to summary
public static void appendAttributes(IBuffer result, Properties attributes)

Appends the attributes to result. The attributes are added on a single line as: key1="value1" key2="value2" ... (a space is added before the first key)

Parameters
result:IBuffer

the buffer to append attributes to.

attributes:Properties

the attributes to append (may be null).

escapeback to summary
public static String escape(String input)
extractCommentback to summary
public static String extractComment(String tag, Properties properties)
xmlback to summary
public static String xml(String indent, String name, String content, Properties attributes)

Generate tag. An opening and closing tag will be generated even if value is null.

Parameters
indent:String

indent

name:String

name of the tag

content:String

content for this tag (or null)

attributes:Properties

tag attributes (or null)

Returns:String

The String value of the generated tag

xmlCloseback to summary
public static void xmlClose(IBuffer result, String indent, String tag, String comment)
xmlOpenback to summary
public static void xmlOpen(IBuffer result, String indent, String tag, Properties attributes)
xmlOpenback to summary
public static void xmlOpen(IBuffer result, String indent, String tag, Properties attributes, boolean noNewLine)
xmlOptionalback to summary
public static void xmlOptional(IBuffer result, String sp, String elementName, Boolean value, Properties attributes)
xmlOptionalback to summary
public static void xmlOptional(IBuffer result, String sp, String elementName, String value, Properties attributes)
xmlRequiredback to summary
public static void xmlRequired(IBuffer result, String sp, String elementName, String value, Properties attributes)