|
OpenOffice.org XMerge API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openoffice.xmerge.converter.xml.sxw.pocketword.PocketWordDocument
Class representing a Pocket Word Document.
PocketWordDocument
is used to create new Pocket Word documents
and to read existing data to allow for conversion to OpenOffice Writer
format.
Fields inherited from interface org.openoffice.xmerge.converter.xml.sxw.pocketword.PocketWordConstants |
AQUA, BLACK, BLUE, COLOUR_TAG, DEFAULT_STYLE, FILE_EXTENSION, FONT_SIZE_TAG, FONT_TAG, FONT_WEIGHT_BOLD, FONT_WEIGHT_FINE, FONT_WEIGHT_NORMAL, FONT_WEIGHT_TAG, FONT_WEIGHT_THICK, FORMATTING_TAG, FUCHSIA, GREEN, GREY, HIGHLIGHT_TAG, ITALIC_TAG, LIME, MAROON, NAVY, OLIVE, PARAGRAPH_STYLE_FAMILY, PURPLE, RED, SILVER, STRIKETHROUGH_TAG, TEAL, TEXT_STYLE_FAMILY, UNDERLINE_TAG, WHITE, YELLOW |
Constructor Summary | |
PocketWordDocument(java.lang.String name)
Constructs a new Pocket Word Document. |
Method Summary | |
void |
addParagraph(ParaStyle style,
boolean listElement)
This method adds a new paragraph element to the document. |
void |
addParagraphData(java.lang.String data,
TextStyle style)
This method adds text to the current paragraph. |
java.lang.String |
getFileName()
Returns the Document name with file extension. |
java.lang.String |
getName()
Returns the Document name with no file extension. |
java.util.Enumeration |
getParagraphEnumeration()
Method to provide access to all of the Paragraph objects
in the Document . |
void |
read(java.io.InputStream docData)
This method reads byte data from the InputStream and
extracts font and paragraph data from the file. |
void |
write(java.io.OutputStream os)
Writes out the Document content to the specified
OutputStream . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PocketWordDocument(java.lang.String name)
Constructs a new Pocket Word Document.
This new document does notcontain any information. Document data must
either be added using appropriate methods, or an existing file can be
read
from an InputStream
.
name
- The name of the PocketWordDocument
.Method Detail |
public void addParagraph(ParaStyle style, boolean listElement)
This method adds a new paragraph element to the document. No string data is added to the paragraph.
N.B. The newly added paragraph becomes the current paragraph and is used as the target for all subsequent calls to addParagraphData().
style
- Paragraph Style object describing the formatting for
the new paragraph. Can be null.listElement
- true if this paragraph is to be bulleted;
false otherwise.public void addParagraphData(java.lang.String data, TextStyle style)
This method adds text to the current paragraph.
If no paragraphs exist within the document, it creates one.
data
- The string data for this segment.style
- Text Style object describing the formatting of this
segment. Can be null.public java.lang.String getFileName()
Returns the Document
name with file extension.
getFileName
in interface Document
Document
name with file extension.public java.lang.String getName()
Returns the Document
name with no file extension.
getName
in interface Document
Document
name with no file extension.public java.util.Enumeration getParagraphEnumeration()
Method to provide access to all of the Paragraph
objects
in the Document
.
Enumeration
over the paragraphs in the document.public void read(java.io.InputStream docData) throws java.io.IOException
This method reads byte
data from the InputStream and
extracts font and paragraph data from the file.
read
in interface Document
is
- InputStream containing a Pocket Word data file.java.io.IOException
- In case of any I/O errors.public void write(java.io.OutputStream os) throws java.io.IOException
Writes out the Document
content to the specified
OutputStream
.
This method may not be thread-safe. Implementations may or may not synchronize this method. User code (i.e. caller) must make sure that calls to this method are thread-safe.
write
in interface Document
os
- OutputStream
to write out the
Document
content.java.io.IOException
- If any I/O error occurs.
|
OpenOffice.org XMerge API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |