|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jacoco.report.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,
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 nameMethod Detail |
---|
protected void beginOpenTag() throws IOException
IOException
- in case of problems with the writerprotected void addChildElement(XMLElement child) throws IOException
child
- child element to add
IOException
- in case of invalid nesting or problems with the writerpublic XMLElement attr(String name, String value) throws IOException
name
- attribute namevalue
- attribute value
IOException
- in case of problems with the writerpublic XMLElement attr(String name, int value) throws IOException
name
- attribute namevalue
- attribute value
IOException
- in case of problems with the writerpublic XMLElement text(String text) throws IOException
text
- text to add
IOException
- in case of problems with the writerpublic XMLElement element(String name) throws IOException
name
- name of the child element
IOException
- in case of problems with the writerpublic 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 |