Package writer2latex.xmerge
Class DOMDocument
- java.lang.Object
-
- writer2latex.xmerge.DOMDocument
-
- All Implemented Interfaces:
OutputFile
,Document
- Direct Known Subclasses:
NewDOMDocument
,XhtmlDocument
public class DOMDocument extends java.lang.Object implements Document
An implementation ofDocument
for StarOffice documents.
-
-
Constructor Summary
Constructors Constructor 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 setnamespaceAware
andvalidating
flags.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.w3c.dom.Document
getContentDOM()
Return a DOMDocument
object of the document content file.protected java.lang.String
getFileExtension()
Returns the file extension of theDocument
represented.java.lang.String
getFileName()
Return the file name of theDocument
, possibly with the standard extension.java.lang.String
getName()
Return the name of theDocument
.void
initContentDOM()
Initializes a new DOMDocument
with the content containing minimum XML tags.void
read(java.io.InputStream is)
Read the OfficeDocument
from the specifiedInputStream
.void
setContentDOM(org.w3c.dom.Node newDom)
Sets the Content of theDocument
to the contents of the suppliedNode
list.void
write(java.io.OutputStream os)
Write out content to the suppliedOutputStream
.
-
-
-
Constructor Detail
-
DOMDocument
public DOMDocument(java.lang.String name, java.lang.String ext)
Default constructor.- Parameters:
name
-Document
name.ext
-Document
extension.
-
DOMDocument
public DOMDocument(java.lang.String name, java.lang.String ext, boolean namespaceAware, boolean validating)
Constructor with arguments to setnamespaceAware
andvalidating
flags.- Parameters:
name
-Document
name (may or may not contain extension).ext
-Document
extension.namespaceAware
- Value fornamespaceAware
flag.validating
- Value forvalidating
flag.
-
-
Method Detail
-
getFileExtension
protected java.lang.String getFileExtension()
Returns the file extension of theDocument
represented.- Returns:
- file extension of the
Document
.
-
getContentDOM
public org.w3c.dom.Document getContentDOM()
Return a DOMDocument
object of the document content file. Note that a content DOM is not created when the constructor is called. So, either theread
method or theinitContentDOM
method will need to be called ahead on this object before calling this method.- Returns:
- DOM
Document
object.
-
setContentDOM
public void setContentDOM(org.w3c.dom.Node newDom)
Sets the Content of theDocument
to the contents of the suppliedNode
list.- Parameters:
newDom
- DOMDocument
object.
-
getName
public java.lang.String getName()
Return the name of theDocument
.
-
getFileName
public java.lang.String getFileName()
Return the file name of theDocument
, possibly with the standard extension.- Specified by:
getFileName
in interfaceOutputFile
- Returns:
- The file name of
Document
.
-
read
public void read(java.io.InputStream is) throws java.io.IOException
Read the OfficeDocument
from the specifiedInputStream
.
-
write
public void write(java.io.OutputStream os) throws java.io.IOException
Write out content to the suppliedOutputStream
.- Specified by:
write
in interfaceOutputFile
- Parameters:
os
- XMLOutputStream
.- Throws:
java.io.IOException
- If any I/O error occurs.
-
initContentDOM
public final void initContentDOM() throws java.io.IOException
Initializes a new DOMDocument
with the content containing minimum XML tags.- Throws:
java.io.IOException
- If any I/O error occurs.
-
-