writer2latex.xmerge

Class DOMDocument

Implemented Interfaces:
Document, OutputFile
Known Direct Subclasses:
NewDOMDocument, XhtmlDocument

public class DOMDocument
extends java.lang.Object
implements Document

An implementation of Document for StarOffice documents.

Constructor Summary

DOMDocument(String name, String ext)
Default constructor.
DOMDocument(String name, String ext, boolean namespaceAware, boolean validating)
Constructor with arguments to set namespaceAware and validating flags.

Method Summary

Document
getContentDOM()
Return a DOM Document object of the document content file.
protected String
getFileExtension()
Returns the file extension of the Document represented.
String
getFileName()
Return the file name of the Document, possibly with the standard extension.
String
getName()
Return the name of the Document.
void
initContentDOM()
Initializes a new DOM Document with the content containing minimum XML tags.
void
read(InputStream is)
Read the Office Document from the specified InputStream.
void
setContentDOM(Node newDom)
Sets the Content of the Document to the contents of the supplied Node list.
void
write(OutputStream os)
Write out content to the supplied OutputStream.

Constructor Details

DOMDocument

public DOMDocument(String name,
                   String ext)
Default constructor.
Parameters:
name - Document name.
ext - Document extension.

DOMDocument

public DOMDocument(String name,
                   String ext,
                   boolean namespaceAware,
                   boolean validating)
Constructor with arguments to set namespaceAware and validating flags.
Parameters:
name - Document name (may or may not contain extension).
ext - Document extension.
namespaceAware - Value for namespaceAware flag.
validating - Value for validating flag.

Method Details

getContentDOM

public Document getContentDOM()
Return a DOM 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.
Returns:
DOM Document object.

getFileExtension

protected String getFileExtension()
Returns the file extension of the Document represented.
Returns:
file extension of the Document.

getFileName

public String getFileName()
Return the file name of the Document, possibly with the standard extension.
Specified by:
getFileName in interface OutputFile
Returns:
The file name of Document.

getName

public String getName()
Return the name of the Document.
Specified by:
getName in interface Document
Returns:
The name of Document.

initContentDOM

public final void initContentDOM()
            throws IOException
Initializes a new DOM Document with the content containing minimum XML tags.

read

public void read(InputStream is)
            throws IOException
Read the Office Document from the specified InputStream.
Specified by:
read in interface Document
Parameters:
is - Office document InputStream.

setContentDOM

public void setContentDOM(Node newDom)
Sets the Content of the Document to the contents of the supplied Node list.
Parameters:
newDom - DOM Document object.

write

public void write(OutputStream os)
            throws IOException
Write out content to the supplied OutputStream.
Specified by:
write in interface OutputFile
Parameters:
os - XML OutputStream.