public class VDocument
extends java.lang.Object
Document offering a Parent-Chaining fluent interface.| Modifier and Type | Method | Description |
|---|---|---|
org.w3c.dom.Document |
getW3cDocument() |
Returns thd underlying w3c
Document. |
static VDocument |
of(java.lang.String rootName) |
Creates a document with a root element of the specified name.
|
static VDocument |
of(org.w3c.dom.Document w3cDocument) |
Creates a
VDocument wrapping the specified w3c document. |
static VDocument |
parse(java.io.InputStream inputStream) |
Same as
parse(InputStream, DocumentBuilder) but using a default DocumentBuilder. |
static VDocument |
parse(java.io.InputStream inputStream,
javax.xml.parsers.DocumentBuilder documentBuilder) |
Creates a
VDocument by parsing the content of specified input stream. |
void |
print(java.io.OutputStream out) |
Outputs xml in the specified stream.
|
void |
print(java.io.OutputStream out,
java.util.function.Consumer<javax.xml.transform.Transformer> transformerConfigurer) |
Same as
print(OutputStream) but caller can modify the default XML transformer using the
specified Consumer. |
VElement<VDocument> |
root() |
Returns the root element of this document.
|
public static VDocument of(org.w3c.dom.Document w3cDocument)
VDocument wrapping the specified w3c document.public static VDocument of(java.lang.String rootName)
public static VDocument parse(java.io.InputStream inputStream, javax.xml.parsers.DocumentBuilder documentBuilder)
VDocument by parsing the content of specified input stream.
The stream content is parsed with the specified documentBuilder.public static VDocument parse(java.io.InputStream inputStream)
parse(InputStream, DocumentBuilder) but using a default DocumentBuilder.public org.w3c.dom.Document getW3cDocument()
Document.public void print(java.io.OutputStream out)
public void print(java.io.OutputStream out,
java.util.function.Consumer<javax.xml.transform.Transformer> transformerConfigurer)
print(OutputStream) but caller can modify the default XML transformer using the
specified Consumer.