|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jacoco.report.internal.xml.XMLElement
public class XMLElement
Simple API to create well formed XML streams. A XMLElement instance
represents a single element in a XML document.
XMLDocument| Field Summary | |
|---|---|
protected Writer |
writer
Writer for content output |
| Constructor Summary | |
|---|---|
protected |
XMLElement(Writer writer,
String name)
Creates a new element for a XML document. |
| Method Summary | |
|---|---|
protected void |
addChildElement(XMLElement child)
Adds the given child to this element. |
XMLElement |
attr(String name,
int value)
Adds an attribute to this element. |
XMLElement |
attr(String name,
long value)
Adds an attribute to this element. |
XMLElement |
attr(String name,
String value)
Adds an attribute to this element. |
protected void |
beginOpenTag()
Emits the beginning of the open tag. |
void |
close()
Closes this element if it has not been closed before. |
XMLElement |
element(String name)
Creates a new child element for this element, |
XMLElement |
text(String text)
Adds the given text as a child to this node. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Writer writer
| Constructor Detail |
|---|
protected XMLElement(Writer writer,
String name)
writer - all output will be written directly to thisname - element name| Method Detail |
|---|
protected void beginOpenTag()
throws IOException
IOException - in case of problems with the writer
protected void addChildElement(XMLElement child)
throws IOException
child - child element to add
IOException - in case of invalid nesting or problems with the writer
public XMLElement attr(String name,
String value)
throws IOException
null the attribute will not
be added.
name - attribute namevalue - attribute value or null
IOException - in case of problems with the writer
public XMLElement attr(String name,
int value)
throws IOException
name - attribute namevalue - attribute value
IOException - in case of problems with the writer
public XMLElement attr(String name,
long value)
throws IOException
name - attribute namevalue - attribute value
IOException - in case of problems with the writer
public XMLElement text(String text)
throws IOException
text - text to add
IOException - in case of problems with the writer
public XMLElement element(String name)
throws IOException
name - name of the child element
IOException - in case of problems with the writer
public void close()
throws IOException
IOException - in case of problems with the writer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||