|
||||||||||
| 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 with minimal memory overhead. A
XMLElement instance represents a single element in a XML document.
XMLElement can be used directly or might be subclassed for schema
specific convenience methods.
| Field Summary | |
|---|---|
protected Writer |
writer
Writer for content output |
| Constructor Summary | |
|---|---|
|
XMLElement(String name,
String pubId,
String system,
boolean standalone,
String encoding,
OutputStream output)
Creates a root element of a XML document. |
protected |
XMLElement(String name,
XMLElement parent)
Creates a new child element within a XML document. |
| Method Summary | |
|---|---|
void |
attr(String name,
int value)
Adds an attribute to this element. |
void |
attr(String name,
long value)
Adds an attribute to this element. |
void |
attr(String name,
String value)
Adds an attribute to this element. |
void |
close()
Closes this element if it has not been closed before. |
XMLElement |
element(String name)
Creates a new child element for this element. |
void |
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 |
|---|
public XMLElement(String name,
String pubId,
String system,
boolean standalone,
String encoding,
OutputStream output)
throws IOException
name - element namepubId - optional schema public identifiersystem - optional schema system identifierstandalone - if true the document is declared as standaloneencoding - character encoding used for outputoutput - output stream will be closed if the root element is closed
IOException - in case of problems with the underlying output
protected XMLElement(String name,
XMLElement parent)
throws IOException
name - element nameparent - parent of this element
IOException - in case of problems with the underlying output or if the
parent element is already closed| Method Detail |
|---|
public final void 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 underlying output or if the
element is already closed.
public final void attr(String name,
int value)
throws IOException
name - attribute namevalue - attribute value
IOException - in case of problems with the underlying output or if the
element is already closed.
public final void attr(String name,
long value)
throws IOException
name - attribute namevalue - attribute value
IOException - in case of problems with the underlying output or if the
element is already closed.
public final void text(String text)
throws IOException
text - text to add
IOException - in case of problems with the underlying output or if the
element is already closed.
public XMLElement element(String name)
throws IOException
name - name of the child element
IOException - in case of problems with the underlying output
public final void close()
throws IOException
IOException - in case of problems with the underlying output
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||