public interface XMLWriter
Modifier and Type | Method and Description |
---|---|
void |
endDocument()
Causes all open elements, including the document root element, to be closed.
|
XMLWriterNamespaceManager |
getNamespacePrefixes() |
String |
getXMLBase() |
void |
setEncoding(String encoding)
Sets the encoding for the document that the RDF writer produces.
|
void |
setWrapAttributes(boolean b)
Causes the current element's attributes to be wrapped in the output.
|
void |
startDocument(IRI rootElement)
Starts writing the document.
|
void |
writeAttribute(IRI attr,
String val)
Writes an attribute of the last element to be started (that has not been closed).
|
void |
writeAttribute(String attr,
String val)
Writes an attribute of the last element to be started (that has not been closed).
|
void |
writeComment(String commentText) |
void |
writeEndElement()
Writes the closing tag of the last element to be started.
|
void |
writeStartElement(IRI name)
Writes the start of an element.
|
void |
writeTextContent(String text)
Writes a text element
|
void setEncoding(@Nonnull String encoding)
UTF-8
.encoding
- The encoding.@Nonnull XMLWriterNamespaceManager getNamespacePrefixes()
void setWrapAttributes(boolean b)
b
- If true
then the attributes will be wrapped if they are long. If
false
then no attribute wrapping will occur.void startDocument(@Nonnull IRI rootElement) throws IOException
rootElement
- The iri of the root element.IOException
- if there was an IO problemvoid endDocument() throws IOException
IOException
- if there was an IO problemvoid writeStartElement(@Nonnull IRI name) throws IOException
name
- The tag name of the element to be written. This must be a valid QName.IOException
- if there was an IO problemIllegalElementNameException
- if the specified name is not a valid QNamevoid writeEndElement() throws IOException
IOException
- if there was an IO problemvoid writeAttribute(@Nonnull String attr, @Nonnull String val) throws IOException
writeAttribute(IRI, String)
attr
- The name of the attributeval
- The value of the attributeIOException
- if there was an IO problemvoid writeAttribute(@Nonnull IRI attr, String val) throws IOException
attr
- The name of the attributeval
- The value of the attributeIOException
- if there was an IO problemvoid writeTextContent(@Nonnull String text) throws IOException
text
- The text to be writtenIOException
- if there was an IO problemvoid writeComment(@Nonnull String commentText) throws IOException
commentText
- comment textIOException
- if there was an IO problemCopyright © 2020 The University of Manchester. All rights reserved.