| java.lang.Object com.xoetrope.io.XExportHelper
All known Subclasses: com.xoetrope.io.HtmlExportHelper, com.xoetrope.io.ExcelExportHelper, com.xoetrope.io.XmlExportHelper,
XExportHelper | public class XExportHelper implements ClipboardOwner(Code) | | A helper class top assist in exporting data to various formats
This class is the basis of all exporters.
Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
the GNU Public License (GPL), please see license.txt for more details. If
you make commercial use of this software you must purchase a commercial
license from Xoetrope.
$Revision: 1.8 $
|
Method Summary | |
public void | addStyle(String sectionName, String styleName) | public void | close() | public void | closeElement() | public void | endDocument() | public void | endElement() | public void | endElement(String styleName) Write the end of an element opening
Parameters: styleName - the style of the section title, or the section name e.g. | public void | endHeader() | public void | endRecord() | public void | endTable() | public void | lostOwnership(Clipboard aClipboard, Transferable aContents) Empty implementation of the ClipboardOwner interface. | public void | matchElement() | protected String | prepareFieldName(String name) | public void | removeHint(String name) | public void | setClipboardContents(String aString) Place a String on the clipboard, and make this class the
owner of the Clipboard's contents. | public void | setComponentFactory(XComponentFactory cf) Set the component factory. | public void | setFieldNameSeparator(String separatorStr) | public void | setFieldSeparator(String separatorStr) | public void | setHint(String name, String value) | public void | setLeftDelimiter(String delimStr) | public void | setOutputElementNames(boolean doOutput) | public void | setOutputFieldNames(boolean doOutput) | public void | setOutputWriter(Writer w) Set a new output writer. | public void | setRightDelimiter(String delimStr) | public void | setUseWindowsLineEnd(boolean use) | public Writer | setupWriter(XPage owner, String fileName) | public void | startDocument() | public void | startElement(String elementName) | public void | startElement(String elementName, String styleName) Write the begining/opening of an element
Parameters: elementName - the element name Parameters: styleName - the style of the section title, or the section name e.g. | public void | startHeader() | public void | startRecord() | public void | startTable() | public void | writeBlankLine() | public void | writeBreak() | public void | writeElement(String elementName, String name, String value) | public void | writeElement(String elementName, String[] names, String[] values) | public void | writeField(String name, String value) | public void | writeHorizontalLine() | public void | writeImage(String imageName, String altText) | public void | writeLine(String text) | public void | writeSectionEnd() | public void | writeSectionTitle(String text) | public void | writeSectionTitle(String text, String styleName) Write the section title and terminate with a line feed, new line as appropriate
Parameters: text - the text to output Parameters: styleName - the style of the section title, or the section name e.g. | public void | writeText(String name, String value, String styleName) |
ALT_TABLE_BOLD_STYLE | final public static String ALT_TABLE_BOLD_STYLE(Code) | | Style name for the export/report alternate table bold elements
|
ALT_TABLE_STYLE | final public static String ALT_TABLE_STYLE(Code) | | Style name for the export/report alternate rows in tables
|
BODY_STYLE | final public static String BODY_STYLE(Code) | | Style name for the export/report body text
|
CAPTION_STYLE | final public static String CAPTION_STYLE(Code) | | Style name for the export/report captions
|
FOOTER_STYLE | final public static String FOOTER_STYLE(Code) | | Style name for the export/report footer
|
HEADER_STYLE | final public static String HEADER_STYLE(Code) | | Style name for the export/report header
|
SECTION_TITLE_STYLE | final public static String SECTION_TITLE_STYLE(Code) | | Style name for the export/report section heading
|
SUB_SECTION_STYLE | final public static String SUB_SECTION_STYLE(Code) | | Style name for the export/report subSection heading
|
SUB_TITLE_STYLE | final public static String SUB_TITLE_STYLE(Code) | | Style name for the export/report subTitle
|
TABLE_BOLD_STYLE | final public static String TABLE_BOLD_STYLE(Code) | | Style name for the export/report table bold elements
|
TABLE_HEADER_STYLE | final public static String TABLE_HEADER_STYLE(Code) | | Style name for the export/report table headers
|
TABLE_STYLE | final public static String TABLE_STYLE(Code) | | Style name for the export/report table
|
TITLE_STYLE | final public static String TITLE_STYLE(Code) | | Style name for the export/report main title
|
beginElement | protected String beginElement(Code) | | The start element e.g. <p> for the html exporter
|
currentProject | protected XProject currentProject(Code) | | The current project
|
defaultExtension | protected String defaultExtension(Code) | | The default file extension
|
elementClosure | protected String elementClosure(Code) | | An element used in closing some other element e.g. / for closing XML elements
|
elementNames | protected Stack elementNames(Code) | | The stack of nested element names being process
|
emptyBytes | protected static String emptyBytes(Code) | | A common byte string used to initialize various tags and elements internally
|
endElement | protected String endElement(Code) | | The end or closing element, e.g. </p> for the html exporter
|
factory | protected XComponentFactory factory(Code) | | The component factory that is used for translation purposes
|
fieldNameSeparator | protected String fieldNameSeparator(Code) | | A separator for field names, used for CSV exports
|
fieldSeparator | protected String fieldSeparator(Code) | | The field separator, e.g. ',' for CSV exports
|
firstField | protected boolean firstField(Code) | | A flag to indicate if an element is the first field to be output
|
lastElementName | protected String lastElementName(Code) | | The name of the last element
|
leftDelimiter | protected String leftDelimiter(Code) | | The left delimiter character
|
lineFeed | protected String lineFeed(Code) | | The line feed sequence
|
outputElementNames | protected boolean outputElementNames(Code) | | A flag to indicate if element names are to be output, some text formats do
not output element names
|
outputFieldNames | protected boolean outputFieldNames(Code) | | A flag to indicate if field names are to be output, some text formats do
not output field names
|
rightDelimiter | protected String rightDelimiter(Code) | | The right delimiter character
|
XExportHelper | public XExportHelper()(Code) | | Create a new export helper, with a default .txt file extension
|
XExportHelper | public XExportHelper(String defExt)(Code) | | Create a new export helper
Parameters: defExt - the default file extension |
addStyle | public void addStyle(String sectionName, String styleName)(Code) | | Add a style name for a particular section of the export
Parameters: sectionName - the export section Parameters: styleName - the style name |
close | public void close() throws IOException(Code) | | Flushes and closes any existing stream
throws: java.io.IOException - thrown if the stream is not ready or if it is in an invalid state |
closeElement | public void closeElement() throws IOException(Code) | | Write the closing of an element
throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
endDocument | public void endDocument() throws IOException(Code) | | Write the ending of a document
throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
endElement | public void endElement() throws IOException(Code) | | Write the end of an element opening
throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
endElement | public void endElement(String styleName) throws IOException(Code) | | Write the end of an element opening
Parameters: styleName - the style of the section title, or the section name e.g. TITLE_SECTION throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
endHeader | public void endHeader() throws IOException(Code) | | Write the ending of a table record
throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
endRecord | public void endRecord() throws IOException(Code) | | Write the ending of a table record
throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
endTable | public void endTable() throws IOException(Code) | | Write the ending of a table
throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
lostOwnership | public void lostOwnership(Clipboard aClipboard, Transferable aContents)(Code) | | Empty implementation of the ClipboardOwner interface.
|
matchElement | public void matchElement() throws IOException(Code) | | Write the matching ending element
throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
prepareFieldName | protected String prepareFieldName(String name)(Code) | | Prepare the field name for export
Parameters: name - the raw name the prepared value |
removeHint | public void removeHint(String name)(Code) | | Remove a hint for the exporter
Parameters: name - the hint name |
setClipboardContents | public void setClipboardContents(String aString)(Code) | | Place a String on the clipboard, and make this class the
owner of the Clipboard's contents.
|
setComponentFactory | public void setComponentFactory(XComponentFactory cf)(Code) | | Set the component factory. This factory is used for translation of values
and names
Parameters: cf - the component factory |
setFieldNameSeparator | public void setFieldNameSeparator(String separatorStr)(Code) | | Set the separator between field names and field values
Parameters: separatorStr - the separator string |
setFieldSeparator | public void setFieldSeparator(String separatorStr)(Code) | | Set the separator character for the fields
Parameters: separatorStr - the separator string |
setHint | public void setHint(String name, String value)(Code) | | Add a hint for the exporter
Parameters: name - the hint name Parameters: value - the hint value |
setLeftDelimiter | public void setLeftDelimiter(String delimStr)(Code) | | Set the field delimiter preceeding the field value
Parameters: delimStr - the delimiter string |
setOutputElementNames | public void setOutputElementNames(boolean doOutput)(Code) | | Output element names as in XML
Parameters: doOutput - true to output element names |
setOutputFieldNames | public void setOutputFieldNames(boolean doOutput)(Code) | | Output field names as in XML
Parameters: doOutput - true to output element names |
setOutputWriter | public void setOutputWriter(Writer w)(Code) | | Set a new output writer. First flushes and closes any existing stream
Parameters: w - the new output writer |
setRightDelimiter | public void setRightDelimiter(String delimStr)(Code) | | Set the field delimiter following the field value
Parameters: delimStr - the delimiter string |
setUseWindowsLineEnd | public void setUseWindowsLineEnd(boolean use)(Code) | | Use Microsoft Windows style line ends
Parameters: use - true for window line endings, otherwise false. |
setupWriter | public Writer setupWriter(XPage owner, String fileName)(Code) | | Create an output writer for the specified file
Parameters: fileName - the fileName the writer or null if the file cannot be created |
startDocument | public void startDocument() throws IOException(Code) | | Write the opening of a document
throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
startElement | public void startElement(String elementName) throws IOException(Code) | | Write the begining/opening of an element
Parameters: elementName - the element name throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
startElement | public void startElement(String elementName, String styleName) throws IOException(Code) | | Write the begining/opening of an element
Parameters: elementName - the element name Parameters: styleName - the style of the section title, or the section name e.g. TITLE_SECTION throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
startHeader | public void startHeader() throws IOException(Code) | | Write the opening of a table record
throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
startRecord | public void startRecord() throws IOException(Code) | | Write the opening of a table record
throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
startTable | public void startTable() throws IOException(Code) | | Write the opening of a table
throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
writeBlankLine | public void writeBlankLine() throws IOException(Code) | | Output a blank line
throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
writeBreak | public void writeBreak() throws IOException(Code) | | Output a line break
throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
writeElement | public void writeElement(String elementName, String name, String value) throws IOException(Code) | | Write the text and terminate with a line feed, new line as appropriate
Parameters: elementName - the element name Parameters: name - the field or attribute name Parameters: value - the field or attribute value throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
writeElement | public void writeElement(String elementName, String[] names, String[] values) throws IOException(Code) | | Write the text and terminate with a line feed, new line as appropriate
Parameters: elementName - the element name Parameters: names - the field or attribute names Parameters: values - the field or attribute value throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
writeField | public void writeField(String name, String value) throws IOException(Code) | | Write a field
Parameters: name - the field name Parameters: value - the field value throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
writeHorizontalLine | public void writeHorizontalLine() throws IOException(Code) | | Output a line/ruler
throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
writeImage | public void writeImage(String imageName, String altText) throws IOException(Code) | | Output an image
Parameters: imageName - the file name Parameters: altText - the alternative text |
writeLine | public void writeLine(String text) throws IOException(Code) | | Write the text and terminate with a line feed, new line as appropriate
Parameters: text - the text to output throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
writeSectionEnd | public void writeSectionEnd() throws IOException(Code) | | Write the end of a section
throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
writeSectionTitle | public void writeSectionTitle(String text) throws IOException(Code) | | Write the section title and terminate with a line feed, new line as appropriate
Parameters: text - the text to output throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
writeSectionTitle | public void writeSectionTitle(String text, String styleName) throws IOException(Code) | | Write the section title and terminate with a line feed, new line as appropriate
Parameters: text - the text to output Parameters: styleName - the style of the section title, or the section name e.g. TITLE_SECTION throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
writeText | public void writeText(String name, String value, String styleName) throws IOException(Code) | | Write a field
Parameters: name - the field name Parameters: value - the field value Parameters: styleName - the style to apply throws: IOException - thrown if the stream is not ready or if it is in an invalid state |
|
|