Package org.testng.reporters
Class XMLUtils
java.lang.Object
org.testng.reporters.XMLUtils
Static helpers for XML.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
appendAttributes
(IBuffer result, Properties attributes) Appends the attributes to result.static String
static String
extractComment
(String tag, Properties properties) static String
xml
(String indent, String name, String content, Properties attributes) Generate tag.static void
static void
xmlOpen
(IBuffer result, String indent, String tag, Properties attributes) static void
xmlOpen
(IBuffer result, String indent, String tag, Properties attributes, boolean noNewLine) static void
xmlOptional
(IBuffer result, String sp, String elementName, Boolean value, Properties attributes) static void
xmlOptional
(IBuffer result, String sp, String elementName, String value, Properties attributes) static void
xmlRequired
(IBuffer result, String sp, String elementName, String value, Properties attributes)
-
Field Details
-
EOL
Platform specific end of line
-
-
Constructor Details
-
XMLUtils
private XMLUtils()
-
-
Method Details
-
xml
public static String xml(String indent, String name, @Nullable String content, @Nullable Properties attributes) Generate tag. An opening and closing tag will be generated even if value is null.- Parameters:
indent
- indentname
- name of the tagcontent
- content for this tag (or null)attributes
- tag attributes (or null)- Returns:
- The String value of the generated tag
-
extractComment
-
xmlOptional
public static void xmlOptional(IBuffer result, String sp, String elementName, Boolean value, Properties attributes) -
xmlOptional
public static void xmlOptional(IBuffer result, String sp, String elementName, @Nullable String value, Properties attributes) -
xmlRequired
public static void xmlRequired(IBuffer result, String sp, String elementName, @Nullable String value, @Nullable Properties attributes) -
xmlOpen
-
appendAttributes
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
- the buffer to append attributes to.attributes
- the attributes to append (may be null).
-
xmlOpen
public static void xmlOpen(IBuffer result, String indent, String tag, Properties attributes, boolean noNewLine) -
xmlClose
-
escape
-