Java Doc for ReportReader.java in  » Report » datavision-1.1.0 » jimm » datavision » 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 » Report » datavision 1.1.0 » jimm.datavision 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.xml.sax.helpers.DefaultHandler
      jimm.datavision.ReportReader

All known Subclasses:   jimm.datavision.gui.sql.DbConnReader,
ReportReader
public class ReportReader extends DefaultHandler (Code)
A report reader reads an XML file and creates the innards of a report.
author:
   Jim Menard, jimm@io.com

Inner Class :static class FormulaConversion

Field Summary
final protected static  doubleDEFAULT_DTD_VERSION
     If there is no report element dtd-version attribute, this is the default value to use.
final protected static  doubleDTD_VERSION_FORMULA_IDS
     This is the DTD version where formula ids were introduced.
protected  Borderborder
    
protected  doubledtdVersion
    
protected  Fieldfield
    
protected  Formulaformula
    
protected  HashMapformulasToConvert
    
protected  Groupgroup
    
protected  booleaninSubreportJoins
    
protected  Lineline
    
protected  booleanmissingColumnSeen
    
protected  intnextSectionLocation
    
protected  Parameterparameter
    
protected  Reportreport
    
protected  Sectionsection
    
protected  Subreportsubreport
    
protected  StacktagNameStack
    
protected  StringtextData
    
protected  UserColumnusercol
    

Constructor Summary
public  ReportReader(Report report)
     Constructor.

Method Summary
protected  voidaddSectionToReport()
     Adds the last seen section to the report.
protected  voidborder(Attributes attributes)
     Reads and creates a new field border.
protected  voidbounds(Attributes attributes)
     Reads and sets the current field's bounds rectangle.
protected  voidcharSepSource(Attributes attributes)
     Reads and creates a CharSepSource.
public  voidcharacters(char ch, int start, int length)
     Reads text data.
protected  voidcolumn(Attributes attributes)
    
protected  voidconvertFormulas()
     Revisits each formula and let it convert formula names to formula id numbers within its eval string.
protected  voiddatabase(Attributes attributes)
     Reads the database tag and creates the database object.
protected  voiddefaultLanguage(Attributes attributes)
    
protected  voidedge(Attributes attributes)
     Reads and creates a new border edge.
public  voidendElement(String namespaceURI, String localName, String qName)
     Handle elements expecting text data.
protected  voidensureNotEmpty(SectionArea area)
     Ensures that the specified collection of sections is not empty.
protected  voidfield(Attributes attributes)
     Reads and creates a field.
protected  ColumnfindColumn(String fullName)
     Returns the column identified by its name.
protected  SelectablefindSelectable(String idStr, String typeStr)
     Returns the selectable identified by its id and type.
protected  voidfooter(String parentTag)
    
protected  voidformat(Attributes attributes)
     Reads and creates the current field's format.
protected  voidformula(String parentTag, Attributes attributes)
     Reads a formula.
protected  ReportgetReport()
    
protected  voidgroup(Attributes attributes)
     Creates a group and adds it to the report.
protected  voidheader(String parentTag)
    
protected  voidjoin(Attributes attributes)
    
protected  voidlanguage(Attributes attributes)
    
protected  voidline(Attributes attributes)
     Reads and creates a new line.
protected  voidncDatabaseSource(Attributes attributes)
     Reads and creates an NCDatabase data source.
protected  voidpaper(Attributes attributes)
     Reads paper size name and orientation.
protected  voidparameter(Attributes attributes)
    
protected  ColorparseColor(String val)
     Parses color string and returns a java.awt.Color.
protected  voidpoint(Attributes attributes)
     Reads a line's point and adds it to the current line.
protected  voidpostParse()
     Performed after a parse, we convert old-style formulas if necessary and ensure that certain report sections are non-empty.
protected  voidquery(Attributes attributes)
     Reads the query.
public  voidread(InputSource in)
     Uses the InputSource to find the XML, reads it, and builds the innards of the report.
public  voidread(File f)
     Reads an XML file and builds the innards of the report.
protected  voidremoveReportSections()
     Removes the report sections that are created when a report is created.
protected  voidreport(Attributes attributes)
     Reads the report tag.
protected  StringrubyLanguageNameHack(String lang)
    
protected  voidsection(Attributes attributes)
     Creates an empty section and adds it to the report.
protected  voidsort(Attributes attributes)
    
public  voidstartElement(String namespaceURI, String localName, String qName, Attributes attributes)
    
protected  voidsubreport(Attributes attributes)
    
protected  voidsuppressionProc(Attributes attributes)
     Reads suppression proc.
protected  voidusercol(Attributes attributes)
     Reads a user column.

Field Detail
DEFAULT_DTD_VERSION
final protected static double DEFAULT_DTD_VERSION(Code)
If there is no report element dtd-version attribute, this is the default value to use. That's because DataVision XML files before version 0.2 didn't include version numbers.



DTD_VERSION_FORMULA_IDS
final protected static double DTD_VERSION_FORMULA_IDS(Code)
This is the DTD version where formula ids were introduced. Versions before this one require runtime conversion.



border
protected Border border(Code)



dtdVersion
protected double dtdVersion(Code)



field
protected Field field(Code)



formula
protected Formula formula(Code)



formulasToConvert
protected HashMap formulasToConvert(Code)



group
protected Group group(Code)



inSubreportJoins
protected boolean inSubreportJoins(Code)



line
protected Line line(Code)



missingColumnSeen
protected boolean missingColumnSeen(Code)



nextSectionLocation
protected int nextSectionLocation(Code)



parameter
protected Parameter parameter(Code)



report
protected Report report(Code)



section
protected Section section(Code)



subreport
protected Subreport subreport(Code)



tagNameStack
protected Stack tagNameStack(Code)



textData
protected String textData(Code)



usercol
protected UserColumn usercol(Code)




Constructor Detail
ReportReader
public ReportReader(Report report)(Code)
Constructor.
Parameters:
  report - the report we are building




Method Detail
addSectionToReport
protected void addSectionToReport()(Code)
Adds the last seen section to the report. The value of nextSectionLocation determines where the section belongs.



border
protected void border(Attributes attributes)(Code)
Reads and creates a new field border.



bounds
protected void bounds(Attributes attributes)(Code)
Reads and sets the current field's bounds rectangle.



charSepSource
protected void charSepSource(Attributes attributes)(Code)
Reads and creates a CharSepSource.



characters
public void characters(char ch, int start, int length)(Code)
Reads text data. Text data inside a single tag can be broken up into multiple calls to this method.



column
protected void column(Attributes attributes)(Code)



convertFormulas
protected void convertFormulas() throws SAXException(Code)
Revisits each formula and let it convert formula names to formula id numbers within its eval string.



database
protected void database(Attributes attributes)(Code)
Reads the database tag and creates the database object. If the report already has a data source (for example, someone has called Report.setDataSource or Report.setDatabaseConnection), then we don't do anything.
See Also:   Report.hasDataSource
See Also:   Report.setDatabaseConnection



defaultLanguage
protected void defaultLanguage(Attributes attributes)(Code)



edge
protected void edge(Attributes attributes)(Code)
Reads and creates a new border edge.



endElement
public void endElement(String namespaceURI, String localName, String qName) throws SAXException(Code)
Handle elements expecting text data.



ensureNotEmpty
protected void ensureNotEmpty(SectionArea area)(Code)
Ensures that the specified collection of sections is not empty. If we do create a section, it is marked as suppressed.
Parameters:
  area - collection of sectionssections



field
protected void field(Attributes attributes)(Code)
Reads and creates a field. If the XML format is really old, we need to convert formula fields by changing their values from the formula name to the formula id.



findColumn
protected Column findColumn(String fullName)(Code)
Returns the column identified by its name. The first time we can not find a column, we report an error to the user.
Parameters:
  fullName - a column name a dataSource column



findSelectable
protected Selectable findSelectable(String idStr, String typeStr)(Code)
Returns the selectable identified by its id and type. The first time we can not find one, we report an error to the user.
Parameters:
  idStr - an id string
Parameters:
  typeStr - a type string ("column", "usercol") a dataSource column



footer
protected void footer(String parentTag)(Code)



format
protected void format(Attributes attributes)(Code)
Reads and creates the current field's format.



formula
protected void formula(String parentTag, Attributes attributes) throws SAXException(Code)
Reads a formula. If the XML format is really old, we need to give each formula an id number and translate its formula text so references to other formulas use the other formula's id number instead of its name.



getReport
protected Report getReport()(Code)



group
protected void group(Attributes attributes)(Code)
Creates a group and adds it to the report.



header
protected void header(String parentTag)(Code)



join
protected void join(Attributes attributes)(Code)



language
protected void language(Attributes attributes)(Code)



line
protected void line(Attributes attributes)(Code)
Reads and creates a new line.



ncDatabaseSource
protected void ncDatabaseSource(Attributes attributes)(Code)
Reads and creates an NCDatabase data source.



paper
protected void paper(Attributes attributes)(Code)
Reads paper size name and orientation.



parameter
protected void parameter(Attributes attributes) throws SAXException(Code)



parseColor
protected Color parseColor(String val)(Code)
Parses color string and returns a java.awt.Color.



point
protected void point(Attributes attributes)(Code)
Reads a line's point and adds it to the current line.



postParse
protected void postParse() throws SAXException(Code)
Performed after a parse, we convert old-style formulas if necessary and ensure that certain report sections are non-empty.



query
protected void query(Attributes attributes)(Code)
Reads the query. Nothing to do, since the data source already has an empty query.



read
public void read(InputSource in) throws Exception(Code)
Uses the InputSource to find the XML, reads it, and builds the innards of the report. To specify a URL, use new InputSource("http://...").
Parameters:
  in - the input source



read
public void read(File f) throws Exception(Code)
Reads an XML file and builds the innards of the report.
Parameters:
  f - the XML file



removeReportSections
protected void removeReportSections()(Code)
Removes the report sections that are created when a report is created.



report
protected void report(Attributes attributes)(Code)
Reads the report tag.



rubyLanguageNameHack
protected String rubyLanguageNameHack(String lang)(Code)



section
protected void section(Attributes attributes)(Code)
Creates an empty section and adds it to the report.



sort
protected void sort(Attributes attributes)(Code)



startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes attributes) throws SAXException(Code)



subreport
protected void subreport(Attributes attributes)(Code)



suppressionProc
protected void suppressionProc(Attributes attributes)(Code)
Reads suppression proc.



usercol
protected void usercol(Attributes attributes) throws SAXException(Code)
Reads a user column. Value of user column will be read later.



Methods inherited from org.xml.sax.helpers.DefaultHandler
public void characters(char ch, int start, int length) throws SAXException(Code)(Java Doc)
public void endDocument() throws SAXException(Code)(Java Doc)
public void endElement(String uri, String localName, String qName) throws SAXException(Code)(Java Doc)
public void endPrefixMapping(String prefix) throws SAXException(Code)(Java Doc)
public void error(SAXParseException e) throws SAXException(Code)(Java Doc)
public void fatalError(SAXParseException e) throws SAXException(Code)(Java Doc)
public void ignorableWhitespace(char ch, int start, int length) throws SAXException(Code)(Java Doc)
public void notationDecl(String name, String publicId, String systemId) throws SAXException(Code)(Java Doc)
public void processingInstruction(String target, String data) throws SAXException(Code)(Java Doc)
public InputSource resolveEntity(String publicId, String systemId) throws IOException, SAXException(Code)(Java Doc)
public void setDocumentLocator(Locator locator)(Code)(Java Doc)
public void skippedEntity(String name) throws SAXException(Code)(Java Doc)
public void startDocument() throws SAXException(Code)(Java Doc)
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException(Code)(Java Doc)
public void startPrefixMapping(String prefix, String uri) throws SAXException(Code)(Java Doc)
public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException(Code)(Java Doc)
public void warning(SAXParseException e) throws SAXException(Code)(Java Doc)

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.