| 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 | |
Method Summary | |
protected void | addSectionToReport() Adds the last seen section to the report. | protected void | border(Attributes attributes) Reads and creates a new field border. | protected void | bounds(Attributes attributes) Reads and sets the current field's bounds rectangle. | protected void | charSepSource(Attributes attributes) Reads and creates a CharSepSource. | public void | characters(char ch, int start, int length) Reads text data. | protected void | column(Attributes attributes) | protected void | convertFormulas() Revisits each formula and let it convert formula names to
formula id numbers within its eval string. | protected void | database(Attributes attributes) Reads the database tag and creates the database object. | protected void | defaultLanguage(Attributes attributes) | protected void | edge(Attributes attributes) Reads and creates a new border edge. | public void | endElement(String namespaceURI, String localName, String qName) Handle elements expecting text data. | protected void | ensureNotEmpty(SectionArea area) Ensures that the specified collection of sections is not empty. | protected void | field(Attributes attributes) Reads and creates a field. | protected Column | findColumn(String fullName) Returns the column identified by its name. | protected Selectable | findSelectable(String idStr, String typeStr) Returns the selectable identified by its id and type. | protected void | footer(String parentTag) | protected void | format(Attributes attributes) Reads and creates the current field's format. | protected void | formula(String parentTag, Attributes attributes) Reads a formula. | protected Report | getReport() | protected void | group(Attributes attributes) Creates a group and adds it to the report. | protected void | header(String parentTag) | protected void | join(Attributes attributes) | protected void | language(Attributes attributes) | protected void | line(Attributes attributes) Reads and creates a new line. | protected void | ncDatabaseSource(Attributes attributes) Reads and creates an NCDatabase data source. | protected void | paper(Attributes attributes) Reads paper size name and orientation. | protected void | parameter(Attributes attributes) | protected Color | parseColor(String val) Parses color string and returns a java.awt.Color . | protected void | point(Attributes attributes) Reads a line's point and adds it to the current line. | protected void | postParse() Performed after a parse, we convert old-style formulas if necessary and
ensure that certain report sections are non-empty. | protected void | query(Attributes attributes) Reads the query. | public void | read(InputSource in) Uses the InputSource to find the XML, reads it, and builds the innards
of the report. | public void | read(File f) Reads an XML file and builds the innards of the report. | protected void | removeReportSections() Removes the report sections that are created when a report is created. | protected void | report(Attributes attributes) Reads the report tag. | protected String | rubyLanguageNameHack(String lang) | protected void | section(Attributes attributes) Creates an empty section and adds it to the report. | protected void | sort(Attributes attributes) | public void | startElement(String namespaceURI, String localName, String qName, Attributes attributes) | protected void | subreport(Attributes attributes) | protected void | suppressionProc(Attributes attributes) Reads suppression proc. | protected void | usercol(Attributes attributes) Reads a user column. |
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.
|
dtdVersion | protected double dtdVersion(Code) | | |
inSubreportJoins | protected boolean inSubreportJoins(Code) | | |
missingColumnSeen | protected boolean missingColumnSeen(Code) | | |
nextSectionLocation | protected int nextSectionLocation(Code) | | |
ReportReader | public ReportReader(Report report)(Code) | | Constructor.
Parameters: report - the report we are building |
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.
|
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 |
edge | protected void edge(Attributes attributes)(Code) | | Reads and creates a new border edge.
|
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 |
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.
|
group | protected void group(Attributes attributes)(Code) | | Creates a group and adds it to the report.
|
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.
|
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.
|
section | protected void section(Attributes attributes)(Code) | | Creates an empty section and adds it to the report.
|
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)
|
|
|