|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
jimm.datavision.ReportReader
public class ReportReader
A report reader reads an XML file and creates the innards of a report.
| Nested Class Summary | |
|---|---|
(package private) static class |
ReportReader.FormulaConversion
This class is used when we are converting formulas from the old pre-DTD_VERSION_FORMULA_IDS format to the new format. |
| Field Summary | |
|---|---|
protected Border |
border
|
protected static double |
DEFAULT_DTD_VERSION
If there is no report element dtd-version attribute, this is the default value to use. |
protected static double |
DTD_VERSION_FORMULA_IDS
This is the DTD version where formula ids were introduced. |
protected double |
dtdVersion
|
protected Field |
field
|
protected Formula |
formula
|
protected java.util.HashMap |
formulasToConvert
|
protected Group |
group
|
protected boolean |
inSubreportJoins
|
protected Line |
line
|
protected boolean |
missingColumnSeen
|
protected int |
nextSectionLocation
|
protected Parameter |
parameter
|
protected Report |
report
|
protected Section |
section
|
protected Subreport |
subreport
|
protected java.util.Stack |
tagNameStack
|
protected java.lang.String |
textData
|
protected UserColumn |
usercol
|
| Constructor Summary | |
|---|---|
ReportReader(Report report)
Constructor. |
|
| Method Summary | |
|---|---|
protected void |
addSectionToReport()
Adds the last seen section to the report. |
protected void |
border(org.xml.sax.Attributes attributes)
Reads and creates a new field border. |
protected void |
bounds(org.xml.sax.Attributes attributes)
Reads and sets the current field's bounds rectangle. |
void |
characters(char[] ch,
int start,
int length)
Reads text data. |
protected void |
charSepSource(org.xml.sax.Attributes attributes)
Reads and creates a CharSepSource. |
protected void |
column(org.xml.sax.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(org.xml.sax.Attributes attributes)
Reads the database tag and creates the database object. |
protected void |
defaultLanguage(org.xml.sax.Attributes attributes)
|
protected void |
edge(org.xml.sax.Attributes attributes)
Reads and creates a new border edge. |
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.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(org.xml.sax.Attributes attributes)
Reads and creates a field. |
protected Column |
findColumn(java.lang.String fullName)
Returns the column identified by its name. |
protected Selectable |
findSelectable(java.lang.String idStr,
java.lang.String typeStr)
Returns the selectable identified by its id and type. |
protected void |
footer(java.lang.String parentTag)
|
protected void |
format(org.xml.sax.Attributes attributes)
Reads and creates the current field's format. |
protected void |
formula(java.lang.String parentTag,
org.xml.sax.Attributes attributes)
Reads a formula. |
protected Report |
getReport()
|
protected void |
group(org.xml.sax.Attributes attributes)
Creates a group and adds it to the report. |
protected void |
header(java.lang.String parentTag)
|
protected void |
join(org.xml.sax.Attributes attributes)
|
protected void |
language(org.xml.sax.Attributes attributes)
|
protected void |
line(org.xml.sax.Attributes attributes)
Reads and creates a new line. |
protected void |
ncDatabaseSource(org.xml.sax.Attributes attributes)
Reads and creates an NCDatabase data source. |
protected void |
paper(org.xml.sax.Attributes attributes)
Reads paper size name and orientation. |
protected void |
parameter(org.xml.sax.Attributes attributes)
|
protected java.awt.Color |
parseColor(java.lang.String val)
Parses color string and returns a java.awt.Color. |
protected void |
point(org.xml.sax.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(org.xml.sax.Attributes attributes)
Reads the query. |
void |
read(java.io.File f)
Reads an XML file and builds the innards of the report. |
void |
read(org.xml.sax.InputSource in)
Uses the InputSource to find the XML, reads it, 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(org.xml.sax.Attributes attributes)
Reads the report tag. |
protected java.lang.String |
rubyLanguageNameHack(java.lang.String lang)
|
protected void |
section(org.xml.sax.Attributes attributes)
Creates an empty section and adds it to the report. |
protected void |
sort(org.xml.sax.Attributes attributes)
|
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
|
protected void |
subreport(org.xml.sax.Attributes attributes)
|
protected void |
suppressionProc(org.xml.sax.Attributes attributes)
Reads suppression proc. |
protected void |
usercol(org.xml.sax.Attributes attributes)
Reads a user column. |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final double DEFAULT_DTD_VERSION
protected static final double DTD_VERSION_FORMULA_IDS
protected java.util.Stack tagNameStack
protected Report report
protected Subreport subreport
protected Parameter parameter
protected Formula formula
protected UserColumn usercol
protected Section section
protected Group group
protected Field field
protected java.lang.String textData
protected Border border
protected Line line
protected double dtdVersion
protected java.util.HashMap formulasToConvert
protected int nextSectionLocation
protected boolean missingColumnSeen
protected boolean inSubreportJoins
| Constructor Detail |
|---|
public ReportReader(Report report)
report - the report we are building| Method Detail |
|---|
public void read(org.xml.sax.InputSource in)
throws java.lang.Exception
new
InputSource("http://...").
in - the input source
java.lang.Exception
public void read(java.io.File f)
throws java.lang.Exception
f - the XML file
java.lang.Exceptionprotected void removeReportSections()
protected void postParse()
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionprotected void ensureNotEmpty(SectionArea area)
area - collection of sections
sectionsprotected Report getReport()
public void startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionprotected void header(java.lang.String parentTag)
protected void footer(java.lang.String parentTag)
public void endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
throws org.xml.sax.SAXException
endElement in interface org.xml.sax.ContentHandlerendElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void characters(char[] ch,
int start,
int length)
characters in interface org.xml.sax.ContentHandlercharacters in class org.xml.sax.helpers.DefaultHandlerprotected void report(org.xml.sax.Attributes attributes)
protected void defaultLanguage(org.xml.sax.Attributes attributes)
protected void language(org.xml.sax.Attributes attributes)
protected java.lang.String rubyLanguageNameHack(java.lang.String lang)
protected void database(org.xml.sax.Attributes attributes)
Report.setDataSource or
Report.setDatabaseConnection), then we don't do anything.
Report.hasDataSource(),
Report.setDatabaseConnection(java.sql.Connection)protected void query(org.xml.sax.Attributes attributes)
protected void charSepSource(org.xml.sax.Attributes attributes)
protected void ncDatabaseSource(org.xml.sax.Attributes attributes)
protected void column(org.xml.sax.Attributes attributes)
protected void join(org.xml.sax.Attributes attributes)
protected void sort(org.xml.sax.Attributes attributes)
protected void subreport(org.xml.sax.Attributes attributes)
protected void parameter(org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void formula(java.lang.String parentTag,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void usercol(org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void convertFormulas()
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionprotected void group(org.xml.sax.Attributes attributes)
protected void section(org.xml.sax.Attributes attributes)
protected void addSectionToReport()
nextSectionLocation determines where the section belongs.
protected void field(org.xml.sax.Attributes attributes)
protected void bounds(org.xml.sax.Attributes attributes)
protected void format(org.xml.sax.Attributes attributes)
protected java.awt.Color parseColor(java.lang.String val)
java.awt.Color.
protected void border(org.xml.sax.Attributes attributes)
protected void edge(org.xml.sax.Attributes attributes)
protected void line(org.xml.sax.Attributes attributes)
protected void point(org.xml.sax.Attributes attributes)
protected void paper(org.xml.sax.Attributes attributes)
protected void suppressionProc(org.xml.sax.Attributes attributes)
protected Column findColumn(java.lang.String fullName)
fullName - a column name
protected Selectable findSelectable(java.lang.String idStr,
java.lang.String typeStr)
idStr - an id stringtypeStr - a type string ("column", "usercol")
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||