|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.report.io.simple.AbstractReportDefinitionHandler | +--com.jrefinery.report.io.simple.ElementFactory
The ElementFactory is responsible for creating ReportElements and is called by the ReportDefinitionContentHandler. For details on the format of the parser have a look at the DTD supplied in the distribution or on http://jfreereport.sourceforge.net/
This factory uses the deprecated element classes. These classes will get not extension for new features and as soon as the discrepancy between implemented and possible features gets too huge, this parser will be discontinued.
Field Summary |
Constructor Summary | |
ElementFactory(org.jfree.xml.Parser parser,
java.lang.String finishTag,
Band band)
Creates a new ElementFactory. |
Method Summary | |
void |
characters(char[] ch,
int start,
int length)
Receives some (or all) of the text in the current element. |
protected void |
clearCurrentText()
Removes all text from the textbuffer at the end of a CDATA section. |
protected void |
endDateField()
Ends the date field and adds it to the current band. |
protected void |
endDateFunction()
Ends the date function and adds it to the current band. |
protected void |
endDrawableField()
Ends the drawable element. |
void |
endElement(java.lang.String qName)
SAX handler function that is forwarded from the ReportDefinitionContentHandler. |
protected void |
endImageField()
Ends the image element and adds it to the current band. |
protected void |
endImageFunction()
Ends the image element and adds it to the current band. |
protected void |
endImageRef()
Ends the image element and adds it to the current band. |
protected void |
endImageURLField()
Ends the image element and adds it to the current band. |
protected void |
endImageURLFunction()
Ends the image element and adds it to the current band. |
protected void |
endLabel()
Ends a label tag, sets the static text for the label which was build during the parsing. |
protected void |
endLine()
Ends the line element and adds it to the current band. |
protected void |
endMultilineField()
Ends the multiline text element and adds it to the current band. |
protected void |
endNumberField()
Ends the number field and adds it to the current band. |
protected void |
endNumberFunction()
Ends the number function and adds it to the current band. |
protected void |
endRectangle()
Ends the rectangle shape element and adds it to the current band. |
protected void |
endResourceField()
Ends the resource field and adds it to the current band. |
protected void |
endResourceLabel()
Ends a resource label tag, sets the static key for the resource label, which was build during the parsing. |
protected void |
endShapeField()
Ends the shape element. |
protected void |
endStringField()
Ends the String field and adds it to the current band. |
protected void |
endStringFunction()
Ends the string function and adds it to the current band. |
protected Band |
getCurrentBand()
Returns the current band, which receives the parsed elements. |
protected java.lang.String |
getCurrentText()
Returns the current text of the textbuffer. |
protected void |
getDataElementAttributes(org.xml.sax.Attributes atts)
Appends all data element relevant attributes to the data element parsed. |
protected void |
getFunctionElementAttributes(org.xml.sax.Attributes atts)
Appends all function element relevant attributes to the data element parsed. |
protected void |
getTextElementAttributes(org.xml.sax.Attributes atts)
Reads the attributes that are base for all band-elements, as name, x, y, width, height, font, fontstyle, fontsize and alignment. |
protected int |
parseTextAlignment(java.lang.String alignment,
int defaultAlignment)
Parses the text looking for a text alignment, which is one of "left", "center" or "right". |
protected int |
parseTextVerticalAlignment(java.lang.String alignment,
int defaultAlignment)
Parses the text looking for a text alignment, which is one of "top", "middle"/"center" or "bottom". |
protected void |
startDateField(org.xml.sax.Attributes atts)
Creates a date element (a text element that displays a date value). |
protected void |
startDateFunction(org.xml.sax.Attributes atts)
Begins processing a date function element (which is a text element). |
protected void |
startDrawableField(org.xml.sax.Attributes atts)
Starts a drawable field. |
void |
startElement(java.lang.String qName,
org.xml.sax.Attributes atts)
SAX-Handler function that is forwarded from the ReportDefinitionContentHandler. |
protected void |
startImageField(org.xml.sax.Attributes atts)
Create a ImageElement with an static ImageDataSource. |
protected void |
startImageFunction(org.xml.sax.Attributes atts)
Create a ImageElement with an static ImageDataSource. |
protected void |
startImageRef(org.xml.sax.Attributes atts)
Create a ImageElement with an static ImageDataSource. |
protected void |
startImageURLField(org.xml.sax.Attributes atts)
Create a ImageElement with an static ImageDataSource. |
protected void |
startImageURLFunction(org.xml.sax.Attributes atts)
Create a ImageElement with an static ImageDataSource. |
protected void |
startLabel(org.xml.sax.Attributes atts)
Creates a label element, an text element with an static datasource attached. |
protected void |
startLine(org.xml.sax.Attributes atts)
Creates a LineShapeElement. |
protected void |
startMultilineField(org.xml.sax.Attributes atts)
Creates a text element. |
protected void |
startNumberField(org.xml.sax.Attributes atts)
Creates a number element (a text element that displays a numerical value). |
protected void |
startNumberFunction(org.xml.sax.Attributes atts)
Begins processing a number function element (which is a text element). |
protected void |
startRectangle(org.xml.sax.Attributes atts)
Creates a RectangleShapeElement. |
protected void |
startResourceField(org.xml.sax.Attributes attrs)
Creates a resource field element. |
protected void |
startResourceLabel(org.xml.sax.Attributes attrs)
Creates a resource label element, an text element with an static datasource attached. |
protected void |
startShapeField(org.xml.sax.Attributes atts)
Creates a RectangleShapeElement. |
protected void |
startStringField(org.xml.sax.Attributes atts)
Creates a text element. |
protected void |
startStringFunction(org.xml.sax.Attributes atts)
Begins processing a string function element (which is a text element). |
Methods inherited from class com.jrefinery.report.io.simple.AbstractReportDefinitionHandler |
getContentBase, getFinishTag, getLocator, getNameGenerator, getParser, getReport |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ElementFactory(org.jfree.xml.Parser parser, java.lang.String finishTag, Band band)
parser
- the used parser to coordinate the parsing process.finishTag
- the finish tag, that should trigger the deactivation of this parser.band
- the band that should be defined.
java.lang.NullPointerException
- if the finishTag or the parser are null.Method Detail |
public void startElement(java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
The elements parsed in this factory denote base usecases. Element creation is delegated to the ItemFactory
startElement
in interface org.jfree.xml.ElementDefinitionHandler
qName
- the element name.atts
- the element attributes.
org.xml.sax.SAXException
- if an unknown tag is encountered.ItemFactory
protected Band getCurrentBand()
protected void clearCurrentText()
protected java.lang.String getCurrentText()
public void characters(char[] ch, int start, int length)
characters
in interface org.jfree.xml.ElementDefinitionHandler
characters
in class AbstractReportDefinitionHandler
ch
- character buffer.start
- the start index.length
- the length of the valid character data.public void endElement(java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.jfree.xml.ElementDefinitionHandler
qName
- the element name.
org.xml.sax.SAXException
- if an unknown tag is encountered.protected void startImageRef(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void startImageField(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void startDrawableField(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX error.protected void startImageURLField(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void startImageFunction(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void startImageURLFunction(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void startLine(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void startRectangle(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void startShapeField(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void startLabel(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void startMultilineField(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void startStringField(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void startNumberField(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void startDateField(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void startNumberFunction(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void startDateFunction(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void startStringFunction(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void endLabel() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- if there is a SAX problem.protected void endLine() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- if there is a SAX problem.protected void endShapeField() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- if there is a SAX problem.protected void endRectangle() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- if there is a SAX problem.protected void endImageField() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- if there is a SAX problem.protected void endImageFunction() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- if there is a SAX problem.protected void endImageURLField() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- if there is a SAX problem.protected void endImageURLFunction() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- if there is a SAX problem.protected void endImageRef() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- if there is a SAX problem.protected void endDrawableField() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- if there is a SAX problem.protected void startResourceLabel(org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
attrs
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void startResourceField(org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
attrs
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void endResourceLabel()
protected void endResourceField()
protected void endMultilineField() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- if there is a SAX problem.protected void endStringField() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- if there is a SAX problem.protected void endNumberField() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- if there is a SAX problem.protected void endDateField() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- if there is a SAX problem.protected void endNumberFunction() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- if there is a SAX problem.protected void endStringFunction() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- if there is a SAX problem.protected void endDateFunction() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- if there is a SAX problem.protected void getTextElementAttributes(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected int parseTextAlignment(java.lang.String alignment, int defaultAlignment)
The method returns one of the values: Element.LEFT, Element.CENTER and Element.RIGHT.
alignment
- the alignment.defaultAlignment
- the default alignment.
protected int parseTextVerticalAlignment(java.lang.String alignment, int defaultAlignment)
The method returns one of the values: Element.TOP, Element.BOTTOM and Element.MIDDLE.
alignment
- the alignment.defaultAlignment
- the default alignment.
protected void getDataElementAttributes(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.protected void getFunctionElementAttributes(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
atts
- the attributes.
org.xml.sax.SAXException
- if there is a SAX problem.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |