Java Doc for XExportHelper.java in  » XML-UI » xui32 » com » xoetrope » io » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML UI » xui32 » com.xoetrope.io 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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 $



Field Summary
final public static  StringALT_TABLE_BOLD_STYLE
    
final public static  StringALT_TABLE_STYLE
    
final public static  StringBODY_STYLE
    
final public static  StringCAPTION_STYLE
    
final public static  StringFOOTER_STYLE
    
final public static  StringHEADER_STYLE
    
final public static  StringSECTION_TITLE_STYLE
    
final public static  StringSUB_SECTION_STYLE
    
final public static  StringSUB_TITLE_STYLE
    
final public static  StringTABLE_BOLD_STYLE
    
final public static  StringTABLE_HEADER_STYLE
    
final public static  StringTABLE_STYLE
    
final public static  StringTITLE_STYLE
    
protected  StringbeginElement
     The start element e.g.
protected  XProjectcurrentProject
    
protected  StringdefaultExtension
    
protected  StringelementClosure
     An element used in closing some other element e.g.
protected  StackelementNames
    
protected static  StringemptyBytes
    
protected  StringendElement
     The end or closing element, e.g.
protected  XComponentFactoryfactory
    
protected  StringfieldNameSeparator
    
protected  StringfieldSeparator
     The field separator, e.g.
protected  booleanfirstField
    
protected  Hashtablehints
    
protected  StringlastElementName
    
protected  StringleftDelimiter
    
protected  StringlineFeed
    
protected  booleanoutputElementNames
    
protected  booleanoutputFieldNames
    
protected  StringrightDelimiter
    
protected  Hashtablestyles
    
protected  Writerwriter
    

Constructor Summary
public  XExportHelper()
    
public  XExportHelper(String defExt)
    

Method Summary
public  voidaddStyle(String sectionName, String styleName)
    
public  voidclose()
    
public  voidcloseElement()
    
public  voidendDocument()
    
public  voidendElement()
    
public  voidendElement(String styleName)
     Write the end of an element opening
Parameters:
  styleName - the style of the section title, or the section name e.g.
public  voidendHeader()
    
public  voidendRecord()
    
public  voidendTable()
    
public  voidlostOwnership(Clipboard aClipboard, Transferable aContents)
     Empty implementation of the ClipboardOwner interface.
public  voidmatchElement()
    
protected  StringprepareFieldName(String name)
    
public  voidremoveHint(String name)
    
public  voidsetClipboardContents(String aString)
     Place a String on the clipboard, and make this class the owner of the Clipboard's contents.
public  voidsetComponentFactory(XComponentFactory cf)
     Set the component factory.
public  voidsetFieldNameSeparator(String separatorStr)
    
public  voidsetFieldSeparator(String separatorStr)
    
public  voidsetHint(String name, String value)
    
public  voidsetLeftDelimiter(String delimStr)
    
public  voidsetOutputElementNames(boolean doOutput)
    
public  voidsetOutputFieldNames(boolean doOutput)
    
public  voidsetOutputWriter(Writer w)
     Set a new output writer.
public  voidsetRightDelimiter(String delimStr)
    
public  voidsetUseWindowsLineEnd(boolean use)
    
public  WritersetupWriter(XPage owner, String fileName)
    
public  voidstartDocument()
    
public  voidstartElement(String elementName)
    
public  voidstartElement(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  voidstartHeader()
    
public  voidstartRecord()
    
public  voidstartTable()
    
public  voidwriteBlankLine()
    
public  voidwriteBreak()
    
public  voidwriteElement(String elementName, String name, String value)
    
public  voidwriteElement(String elementName, String[] names, String[] values)
    
public  voidwriteField(String name, String value)
    
public  voidwriteHorizontalLine()
    
public  voidwriteImage(String imageName, String altText)
    
public  voidwriteLine(String text)
    
public  voidwriteSectionEnd()
    
public  voidwriteSectionTitle(String text)
    
public  voidwriteSectionTitle(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  voidwriteText(String name, String value, String styleName)
    

Field Detail
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



hints
protected Hashtable hints(Code)



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



styles
protected Hashtable styles(Code)
A table of styles



writer
protected Writer writer(Code)
The output writer




Constructor Detail
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




Method Detail
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



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.