public interface XMLWriter
| Modifier and Type | Method and Description | 
|---|---|
void | 
addAttribute(String key,
            String value)
Add a XML attribute to the current XML Element. 
 | 
void | 
endElement()
End the previously opened element. 
 | 
void | 
setDocType(String docType)
Sets the DOCTYPE of the document. 
 | 
void | 
setEncoding(String encoding)
Sets the encoding of the document. 
 | 
void | 
startElement(String name)
Start an XML Element tag. 
 | 
void | 
writeMarkup(String text)
Add preformatted markup to the current element tag. 
 | 
void | 
writeText(String text)
Add text to the current element tag. 
 | 
void setEncoding(String encoding)
encoding - the encodingIllegalStateException - if the generation of the document has already startedvoid setDocType(String docType)
docType - the docTypeIllegalStateException - if the generation of the document has already startedvoid startElement(String name) throws IOException
name - the name of the tagIOException - if starting the element failsvoid addAttribute(String key, String value) throws IOException
startElement(String).key - The key of the attribute.value - The value of the attribute.IllegalStateException - if no element tag is currently in processIOException - if adding the attribute fails.void writeText(String text) throws IOException
text - The text which should be written.IllegalStateException - if no element tag got started yetIOException - if writing the text fails.void writeMarkup(String text) throws IOException
text - the text which should be writtenIllegalStateException - if no element tag is started yetIOException - if writing the markup failsvoid endElement()
         throws IOException
IOException - if ending the element fails.startElement(String)Copyright © 2002–2021 The Apache Software Foundation. All rights reserved.