public class DOMDocument extends java.lang.Object implements OutputFile
Constructor and Description |
---|
DOMDocument(java.lang.String name,
java.lang.String ext)
Default constructor.
|
DOMDocument(java.lang.String name,
java.lang.String ext,
boolean namespaceAware,
boolean validating)
Constructor with arguments to set
namespaceAware
and validating flags. |
Modifier and Type | Method and Description |
---|---|
boolean |
containsMath()
Test whether this document contains mathematical formulas
|
org.w3c.dom.Document |
getContentDOM()
Return a DOM
Document object of the document content
file. |
protected java.lang.String |
getFileExtension()
Returns the file extension of the
Document
represented. |
java.lang.String |
getFileName()
Return the file name of the
Document , possibly
with the standard extension. |
java.lang.String |
getMIMEType()
Get the MIME type of the
OutputFile . |
java.lang.String |
getName()
Return the name of the
Document . |
void |
initContentDOM()
Initializes a new DOM
Document with the content
containing minimum XML tags. |
boolean |
isMasterDocument()
Test whether this document is part of the main document flow (master documents) or
an auxiliary document
|
void |
read(java.io.InputStream is)
Read the Office
Document from the specified
InputStream . |
void |
setContentDOM(org.w3c.dom.Node newDom)
Sets the Content of the
Document to the contents of the
supplied Node list. |
void |
write(java.io.OutputStream os)
Write out content to the supplied
OutputStream . |
public DOMDocument(java.lang.String name, java.lang.String ext)
name
- Document
name.ext
- Document
extension.public DOMDocument(java.lang.String name, java.lang.String ext, boolean namespaceAware, boolean validating)
namespaceAware
and validating
flags.name
- Document
name (may or may not
contain extension).ext
- Document
extension.namespaceAware
- Value for namespaceAware
flag.validating
- Value for validating
flag.protected java.lang.String getFileExtension()
Document
represented.Document
.public org.w3c.dom.Document getContentDOM()
Document
object of the document content
file. Note that a content DOM is not created when the constructor
is called. So, either the read
method or the
initContentDOM
method will need to be called ahead
on this object before calling this method.Document
object.public void setContentDOM(org.w3c.dom.Node newDom)
Document
to the contents of the
supplied Node
list.newDom
- DOM Document
object.public java.lang.String getName()
Document
.Document
.public java.lang.String getFileName()
Document
, possibly
with the standard extension.getFileName
in interface OutputFile
Document
.public void read(java.io.InputStream is) throws java.io.IOException
Document
from the specified
InputStream
.is
- Office document InputStream
.java.io.IOException
- If any I/O error occurs.public void write(java.io.OutputStream os) throws java.io.IOException
OutputStream
.
(with pretty printing)write
in interface OutputFile
os
- XML OutputStream
.java.io.IOException
- If any I/O error occurs.public final void initContentDOM() throws java.io.IOException
Document
with the content
containing minimum XML tags.java.io.IOException
- If any I/O error occurs.public java.lang.String getMIMEType()
OutputFile
OutputFile
.getMIMEType
in interface OutputFile
public boolean isMasterDocument()
OutputFile
isMasterDocument
in interface OutputFile
public boolean containsMath()
OutputFile
containsMath
in interface OutputFile