public interface XMLWriter
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(java.lang.String key,
java.lang.String value)
Add a XML attribute to the current XML Element.
|
void |
endElement()
End the previously opened element.
|
void |
setDocType(java.lang.String docType)
Sets the DOCTYPE of the document.
|
void |
setEncoding(java.lang.String encoding)
Sets the encoding of the document.
|
void |
startElement(java.lang.String name)
Start an XML Element tag.
|
void |
writeMarkup(java.lang.String text)
Add preformatted markup to the current element tag.
|
void |
writeText(java.lang.String text)
Add text to the current element tag.
|
void setEncoding(java.lang.String encoding)
encoding
- the encodingjava.lang.IllegalStateException
- if the generation of the document has already startedvoid setDocType(java.lang.String docType)
docType
- the docTypejava.lang.IllegalStateException
- if the generation of the document has already startedvoid startElement(java.lang.String name) throws java.io.IOException
name
- the name of the tagjava.io.IOException
- if starting the element failsvoid addAttribute(java.lang.String key, java.lang.String value) throws java.io.IOException
startElement(String)
.key
- The key of the attribute.value
- The value of the attribute.java.lang.IllegalStateException
- if no element tag is currently in processjava.io.IOException
- if adding the attribute fails.void writeText(java.lang.String text) throws java.io.IOException
text
- The text which should be written.java.lang.IllegalStateException
- if no element tag got started yetjava.io.IOException
- if writing the text fails.void writeMarkup(java.lang.String text) throws java.io.IOException
text
- the text which should be writtenjava.lang.IllegalStateException
- if no element tag is started yetjava.io.IOException
- if writing the markup failsvoid endElement() throws java.io.IOException
java.io.IOException
- if ending the element fails.startElement(String)