|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.testng.reporters.XMLStringBuffer
public class XMLStringBuffer
This class allows you to generate an XML text document by pushing and popping tags from a stack maintained internally.
Constructor Summary | |
---|---|
XMLStringBuffer()
|
|
XMLStringBuffer(java.lang.String start)
|
|
XMLStringBuffer(java.lang.StringBuffer buffer,
java.lang.String start)
|
Method Summary | |
---|---|
void |
addCDATA(java.lang.String content)
Add a CDATA tag. |
void |
addComment(java.lang.String comment)
|
void |
addEmptyElement(java.lang.String tagName)
Add an empty element tag (e.g. |
void |
addEmptyElement(java.lang.String tagName,
java.util.Properties attributes)
Add an empty element tag (e.g. |
void |
addOptional(java.lang.String tagName,
java.lang.Boolean value)
Add an optional Boolean element to the current tag. |
void |
addOptional(java.lang.String tagName,
java.lang.Boolean value,
java.util.Properties attributes)
Add an optional Boolean element to the current tag. |
void |
addOptional(java.lang.String tagName,
java.lang.String value)
Add an optional String element to the current tag. |
void |
addOptional(java.lang.String tagName,
java.lang.String value,
java.util.Properties attributes)
Add an optional String element to the current tag. |
void |
addRequired(java.lang.String tagName,
java.lang.String value)
Add a required element to the current tag. |
void |
addRequired(java.lang.String tagName,
java.lang.String value,
java.util.Properties attributes)
Add a required element to the current tag. |
java.lang.StringBuffer |
getStringBuffer()
|
static void |
main(java.lang.String[] argv)
|
void |
pop()
Pop the last pushed element without verifying it if matches the previously pushed tag. |
void |
pop(java.lang.String tagName)
Pop the last pushed element and throws an AssertionError if it doesn't match the corresponding tag that was pushed earlier. |
void |
push(java.lang.String tagName)
Push a new tag. |
void |
push(java.lang.String tagName,
java.util.Properties attributes)
Push a new tag. |
void |
push(java.lang.String tagName,
java.lang.String schema)
Push a new tag. |
void |
push(java.lang.String tagName,
java.lang.String schema,
java.util.Properties attributes)
Push a new tag. |
void |
setDocType(java.lang.String docType)
Set the doctype for this document. |
void |
setXmlDetails(java.lang.String v,
java.lang.String enc)
Set the xml version and encoding for this document. |
java.lang.String |
toXML()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XMLStringBuffer()
start
- A string of spaces indicating the indentation at which
to start the generation. Note that this constructor will also insert
an
public XMLStringBuffer(java.lang.String start)
start
- A string of spaces indicating the indentation at which
to start the generation. This constructor will not insert an
public XMLStringBuffer(java.lang.StringBuffer buffer, java.lang.String start)
buffer
- The StringBuffer to use internally to represent the
document.start
- A string of spaces indicating the indentation at which
to start the generation.Method Detail |
---|
public void setXmlDetails(java.lang.String v, java.lang.String enc)
v
- the XML versionenc
- the XML encodingpublic void setDocType(java.lang.String docType)
docType
- The DOCTYPE string, without the "<!DOCTYPE " ">"public void push(java.lang.String tagName, java.lang.String schema, java.util.Properties attributes)
tagName
- The name of the tag.schema
- The schema to use (can be null or an empty string).attributes
- A Properties file representing the attributes (or null)public void push(java.lang.String tagName, java.lang.String schema)
tagName
- The name of the tag.schema
- The schema to use (can be null or an empty string).public void push(java.lang.String tagName, java.util.Properties attributes)
tagName
- The name of the tag.attributes
- A Properties file representing the attributes (or null)public void push(java.lang.String tagName)
tagName
- The name of the tag.public void pop()
public void pop(java.lang.String tagName)
tagName
- The name of the tag this pop() is supposed to match.public void addRequired(java.lang.String tagName, java.lang.String value)
tagName
- The name of the tagvalue
- The value for this tagpublic void addRequired(java.lang.String tagName, java.lang.String value, java.util.Properties attributes)
tagName
- The name of the tagvalue
- The value for this tagattributes
- A Properties file containing the attributes (or null)public void addOptional(java.lang.String tagName, java.lang.String value, java.util.Properties attributes)
tagName
- The name of the tagvalue
- The value for this tagattributes
- A Properties file containing the attributes (or null)public void addOptional(java.lang.String tagName, java.lang.String value)
tagName
- The name of the tagvalue
- The value for this tagpublic void addOptional(java.lang.String tagName, java.lang.Boolean value, java.util.Properties attributes)
tagName
- The name of the tagvalue
- The value for this tagattributes
- A Properties file containing the attributes (or null)public void addOptional(java.lang.String tagName, java.lang.Boolean value)
tagName
- The name of the tagvalue
- The value for this tagattributes
- A Properties file containing the attributes (or null)public void addEmptyElement(java.lang.String tagName)
tagName
- The name of the tagpublic void addEmptyElement(java.lang.String tagName, java.util.Properties attributes)
tagName
- The name of the tagattributes
- A Properties file containing the attributes (or null)public void addComment(java.lang.String comment)
public void addCDATA(java.lang.String content)
public java.lang.StringBuffer getStringBuffer()
public java.lang.String toXML()
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |