|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.davisor.xml.sax.MultiDocumentHandler
com.davisor.graphics.chart.ChartXMLDocumentHandler
ChartXMLDocumentHandler parses ChartAttributes and
ChartXMLDataBuffers from XML documents. This DocumentHandler
delegates the parsing of the XML document to either
ChartXMLDataBuffer or ChartXMLAttributes depending on the tag that
it encounters. The chart XML document starts with a <chart>
root tag that contains <data> and <attributes>
tags. The data tag starts a data section, which is parsed by a
ChartXMLDataBuffer created at the time that ChartXMLDocumentHandler
encounters the tag. The content of the attribute tag is parsed by
ChartXMLAttributes, respectively. Data buffers and attributes
constructed during the parsing are available through the
getDataBuffer, getDataBuffers,
getChartAttributes and
getChartAttributesIterator methods.
ChartXMLDataBuffer,
ChartXMLAttributes| Field Summary | |
protected org.xml.sax.ErrorHandler |
M_errorHandler
XML error handler for reporting parsing errors. |
| Fields inherited from class com.davisor.xml.sax.MultiDocumentHandler |
M_currentContentHandler, M_currentDocumentHandler, M_currentDocumentHandlers, M_currentDocumentTag, M_finishedDocumentHandlers, M_knownDocumentFactories, M_parser, M_xmlReader |
| Constructor Summary | |
ChartXMLDocumentHandler()
Default constructor. |
|
ChartXMLDocumentHandler(java.net.URL context)
Constructs a new ChartXMLDocumentHandler that uses the specified URL context for loading images and textures. |
|
ChartXMLDocumentHandler(java.net.URL context,
java.util.Map extAttributes)
Constructs a new ChartXMLDocumentHandler that uses the specified URL context for loading images and textures. |
|
ChartXMLDocumentHandler(java.net.URL context,
java.util.Map extAttributes,
org.xml.sax.ErrorHandler errorHandler)
Constructs a new ChartXMLDocumentHandler that uses the specified URL context for loading images and textures, and the specified error handler for reporting parsing errors. |
|
ChartXMLDocumentHandler(java.net.URL context,
java.io.Reader reader)
Constructs a new ChartXMLDocumentHandler that will consume the character input stream and produce corresponding data buffers and attributes. |
|
ChartXMLDocumentHandler(java.net.URL context,
java.io.Reader reader,
org.xml.sax.ErrorHandler errorHandler)
Constructs a new ChartXMLDocumentHandler that will consume the character input stream and produce corresponding data buffers and attributes. |
|
| Method Summary | |
Chart |
createChart()
Creates a new chart from Chart XML. |
Chart |
createChart(java.lang.Number width,
java.lang.Number height,
java.lang.String chartType,
java.lang.String contentType)
Creates a new chart from Chart XML. |
void |
error(org.xml.sax.SAXParseException e)
Receive notification of a recoverable error. |
void |
fatalError(org.xml.sax.SAXParseException e)
Receive notification of a non-recoverable error. |
java.util.Iterator |
getAttributes()
Gets an iterator over all chart attributes parsed from XML documents. |
java.util.Iterator |
getBuffers()
Gets an iterator over all chart data buffers parsed from XML documents. |
ChartXMLAttributes |
getFirstAttributes()
Gets the first chart attributes object parsed from XML documents |
ChartXMLDataBuffer |
getFirstDataBuffer()
Gets the first chart data buffer parsed from XML documents |
void |
parse(java.io.Reader reader)
Parses the input character stream and constructs ChartXMLDataBuffers and ChartXMLAttributes from that input. |
void |
parse(java.io.Reader reader,
org.xml.sax.ErrorHandler errorHandler)
Parses the input character stream and constructs ChartXMLDataBuffers and ChartXMLAttributes from that input. |
void |
warning(org.xml.sax.SAXParseException e)
Receive notification of a warning. |
| Methods inherited from class com.davisor.xml.sax.MultiDocumentHandler |
addDocumentHandlerFactory, addDocumentHandlerFactory, addDocumentHandlerFactory, addDocumentHandlerFactory, addDocumentHandlerFactory, addDocumentHandlerFactory, characters, endDocument, endElement, endElement, endPrefixMapping, getDocumentHandlers, getDocumentHandlers, getTags, ignorableWhitespace, popHandler, processingInstruction, pushHandler, removeDocumentHandlerFactory, removeDocumentHandlerFactory, removeDocumentHandlerFactory, removeDocumentHandlerFactory, removeDocumentHandlerFactory, removeDocumentHandlerFactory, removeDocumentHandlerFactory, setDocumentLocator, skippedEntity, startDocument, startElement, startElement, startPrefixMapping |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected org.xml.sax.ErrorHandler M_errorHandler
| Constructor Detail |
public ChartXMLDocumentHandler()
public ChartXMLDocumentHandler(java.net.URL context,
java.util.Map extAttributes)
context - URL contextextAttributes - external runtime attribute map (may be null)public ChartXMLDocumentHandler(java.net.URL context)
public ChartXMLDocumentHandler(java.net.URL context,
java.io.Reader reader)
throws java.io.IOException
public ChartXMLDocumentHandler(java.net.URL context,
java.io.Reader reader,
org.xml.sax.ErrorHandler errorHandler)
throws java.io.IOException
public ChartXMLDocumentHandler(java.net.URL context,
java.util.Map extAttributes,
org.xml.sax.ErrorHandler errorHandler)
context - URL contextextAttributes - external runtime attribute map (may be null)errorHandler - handler for reporting parsing errors (may be null)| Method Detail |
public void error(org.xml.sax.SAXParseException e)
throws org.xml.sax.SAXException
error in interface org.xml.sax.ErrorHandlerorg.xml.sax.SAXException
public void fatalError(org.xml.sax.SAXParseException e)
throws org.xml.sax.SAXException
fatalError in interface org.xml.sax.ErrorHandlerorg.xml.sax.SAXException
public void warning(org.xml.sax.SAXParseException e)
throws org.xml.sax.SAXException
warning in interface org.xml.sax.ErrorHandlerorg.xml.sax.SAXExceptionpublic java.util.Iterator getAttributes()
public java.util.Iterator getBuffers()
public ChartXMLDataBuffer getFirstDataBuffer()
public ChartXMLAttributes getFirstAttributes()
public Chart createChart()
throws ChartException
ChartException - if chart generation fails
public Chart createChart(java.lang.Number width,
java.lang.Number height,
java.lang.String chartType,
java.lang.String contentType)
throws ChartException
null parameters will override corresponding XML
attribute value. However, the original chart type will always
remain available in underlying ChartXMLAttributes object,
from where it can be retrieved with ChartXMLAttributes.getXMLChartType() method.
width - width (may be null)height - height (may be null)chartType - chart type (may be null)contentType - image mime type (may be null)
ChartException - if chart generation fails
public void parse(java.io.Reader reader)
throws java.io.IOException
This implementation calls parse(Reader, ErrorHandler) with
the set ErrorHandler, which might be null.
reader - character stream reader
java.io.IOExceptionparse(Reader, ErrorHandler)
public void parse(java.io.Reader reader,
org.xml.sax.ErrorHandler errorHandler)
throws java.io.IOException
This implementation tries to use SAX2 compliant XMLReader
constructed in MultiDocumentHandler for parsing. If
XMLReader is not constructed but SAX1 compliant Parser is, uses
Parser. If neither has been constructed, fails.
If the given ErrorHandler is null, this ChartXMLDocumentHandler is used as an ErrorHandler.
reader - character stream readererrorHandler - handler for handling parsing errors (may be null)
java.io.IOExceptionErrorHandler
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||