public final class DocumentWriterImpl extends Object implements DocumentWriter.XmlSpecWriter, DocumentWriter.DoctypeWriter, Supplier<ContentWriter>
DocumentWriter.DoctypeWriter, DocumentWriter.XmlSpecWriter| Modifier and Type | Method and Description |
|---|---|
ContentWriter |
cdata(String content)
Write CDATA content of the currently opened tag.
|
void |
close()
Close the XML document.
1.
|
ContentWriter |
comment(String comment)
Write XML comment into current position.
|
DocumentWriter.DoctypeWriter |
doctype(String name)
Write XML document type to associate document with DTD, ot set it as well known.
|
static DocumentWriter |
documentBuilder(Writer writer,
DocumentWriterConfig config) |
DocumentWriter.XmlSpecWriter |
encoding(String encoding)
Write XML document encoding.
|
ContentWriter |
end()
End currently opened tag.
|
DocumentWriter |
flush()
Flush the content using underlying writer.
|
ContentWriter |
get() |
DocumentWriter |
instruction(String name,
String content)
Write XML processing instruction.
|
DocumentWriter.DoctypeWriter |
publicDtd(String uri,
String dtd) |
DocumentWriter.DoctypeWriter |
systemDtd(String dtd) |
ElementWriter |
tag(String tag)
Start writing opening tag with provided tag name.
|
ElementWriter |
tag(String nsPrefix,
String tag)
Start writing opening tag with provided XML namespace prefix and tag name.
|
ContentWriter |
text(String content)
Write text content of the currently opened tag.
|
DocumentWriter.XmlSpecWriter |
version(String version)
Write XML document version.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitversionpublic static DocumentWriter documentBuilder(Writer writer, DocumentWriterConfig config)
public DocumentWriter.XmlSpecWriter version(String version)
DocumentWriterversion in interface DocumentWriterversion - document version.public DocumentWriter.DoctypeWriter doctype(String name)
DocumentWriterdoctype in interface DocumentWritername - Document type name.public DocumentWriter.DoctypeWriter publicDtd(String uri, String dtd)
publicDtd in interface DocumentWriter.DoctypeWriterpublic DocumentWriter.DoctypeWriter systemDtd(String dtd)
systemDtd in interface DocumentWriter.DoctypeWriterpublic DocumentWriter flush()
DocumentWriterflush in interface ContentWriterflush in interface DocumentWriterpublic DocumentWriter.XmlSpecWriter encoding(String encoding)
DocumentWriter.XmlSpecWriterencoding in interface DocumentWriter.XmlSpecWriterencoding - document encoding.public DocumentWriter instruction(String name, String content)
ContentWriterinstruction in interface ContentWritername - Processing instruction name (e.g. xml-stylesheet).content - Content of the processing instruction tag.public ElementWriter tag(String tag)
ContentWritertag in interface ContentWritertag - Tag name.public ElementWriter tag(String nsPrefix, String tag)
ContentWritertag in interface ContentWriternsPrefix - XML namespace prefix.tag - Tag name.public ContentWriter text(String content)
ContentWritertext in interface ContentWritercontent - Text content to be written.public ContentWriter cdata(String content)
ContentWritercdata in interface ContentWritercontent - CDATA content to be written.public ContentWriter comment(String comment)
ContentWritercomment in interface ContentWritercomment - Content of the comment. Only escape invalid characters.public ContentWriter end()
ContentWriterend in interface ContentWriterpublic void close()
ContentWriterclose in interface ContentWriterpublic ContentWriter get()
get in interface Supplier<ContentWriter>Copyright © 2018. All rights reserved.