|
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.sxc.SxcDocumentSerializer
General spreadsheet implementation of DocumentSerializer
for the SxcPluginFactory
. Used with SXC Document
objects.
The serialize
method traverses the DOM
Document
from the given Document
object.
It uses a DocEncoder
object for the actual conversion
of contents to the device spreadsheet format.
Field Summary | |
protected SpreadsheetEncoder |
encoder
A SpreadsheetEncoder object for encoding to
appropriate format. |
protected SxcDocument |
sxcDoc
SxcDocument object that this converter processes. |
Constructor Summary | |
SxcDocumentSerializer(Document document)
Constructor. |
Method Summary | |
protected void |
addCell(java.lang.String cellValue)
This method will take the input cell value and add it to the spreadsheet Document we are currently
encoding. |
protected int |
calculateContentWidth(java.lang.String content)
This method calculates the width of the input String . |
protected int |
getDecimalPlaces(org.w3c.dom.Node node)
This method takes a table:table-cell Node
and traverses down to the text:p tag. |
protected abstract java.lang.String |
parseFormula(java.lang.String formula)
This abstract method takes a StarOffice formula and parses into the spreadsheet formula format. |
protected void |
processColumnWidth(int column)
This method maintains an array of integers that contains the desired widths (in number of chars) for each column. |
abstract ConvertData |
serialize()
Method to convert a DOM Document into
"Device" Document objects. |
protected void |
traverseBody(org.w3c.dom.Node node)
This method traverses office:body Element . |
protected void |
traverseCell(org.w3c.dom.Node node)
This method traverses a table:table-cell element Node . |
protected void |
traverseParagraph(org.w3c.dom.Node node)
This method traverses the text:p element Node . |
protected void |
traverseTable(org.w3c.dom.Node node)
This method traverses the table:table element Node . |
protected void |
traverseTableColumn(org.w3c.dom.Node node)
This method traverses the table:table-column Node . |
protected void |
traverseTableRow(org.w3c.dom.Node node)
This method traverses the table:table-row element Node . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected SpreadsheetEncoder encoder
SpreadsheetEncoder
object for encoding to
appropriate format.protected SxcDocument sxcDoc
SxcDocument
object that this converter processes.Constructor Detail |
public SxcDocumentSerializer(Document document)
document
- Input SxcDocument
Document
.Method Detail |
protected void addCell(java.lang.String cellValue) throws java.io.IOException
Document
we are currently
encoding. This method correctly handles cells that are
repeated in either the row, cell, or both directions.cellValue
- The contents of the cell we want to add
to the spreadsheet Document
.java.io.IOException
- If any I/O error occurs.protected int calculateContentWidth(java.lang.String content)
String
. This value is used in the calculation
of column widths.content
- The contents from which to calculate
the width.protected int getDecimalPlaces(org.w3c.dom.Node node)
Node
and traverses down to the text:p tag. The value is
extracted from the text:p tag and the number of decimal
places is calculated.node
- A table:table-cell Node
.Node
.protected abstract java.lang.String parseFormula(java.lang.String formula)
formula
- The formula to be parsedprotected void processColumnWidth(int column)
column
- The current column number.public abstract ConvertData serialize() throws ConvertException, java.io.IOException
Method to convert a DOM Document
into
"Device" Document
objects.
This method is not thread safe for performance reasons. This method should not be called from within two threads. It would be best to call this method only once per object instance.
serialize
in interface DocumentSerializer
ConvertData
containing "Device"
Document
objects.ConvertException
- If any conversion error occurs.java.io.IOException
- If any I/O error occurs.protected void traverseBody(org.w3c.dom.Node node) throws java.io.IOException
Element
.node
- office:body Node
.java.io.IOException
- If any I/O error occurs.protected void traverseCell(org.w3c.dom.Node node) throws java.io.IOException
Node
.node
- a table:table-cell Node
.java.io.IOException
- if any I/O error occurs.protected void traverseParagraph(org.w3c.dom.Node node) throws java.io.IOException
Node
.node
- A text:p Node
.java.io.IOException
- If any I/O error occurs.protected void traverseTable(org.w3c.dom.Node node) throws java.io.IOException
Node
.node
- A table:table Node
.java.io.IOException
- If any I/O error occurs.protected void traverseTableColumn(org.w3c.dom.Node node) throws java.io.IOException
Node
. Not yet implemented.node
- A table:table-column Node
.java.io.IOException
- If any I/O error occurs.protected void traverseTableRow(org.w3c.dom.Node node) throws java.io.IOException
Node
.node
- A table:table-row Node
.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 |