Package org.jfree.data.xml
Class ItemHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.jfree.data.xml.ItemHandler
- All Implemented Interfaces:
DatasetTags,ContentHandler,DTDHandler,EntityResolver,ErrorHandler
A handler for reading key-value items.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ComparableThe key.private DefaultHandlerThe parent handler (can be the same as root, but not always).private RootHandlerThe root handler.private NumberThe value.Fields inherited from interface org.jfree.data.xml.DatasetTags
CATEGORYDATASET_TAG, ITEM_TAG, KEY_TAG, PIEDATASET_TAG, SERIES_TAG, VALUE_TAG -
Constructor Summary
ConstructorsConstructorDescriptionItemHandler(RootHandler root, DefaultHandler parent) Creates a new item handler. -
Method Summary
Modifier and TypeMethodDescriptionvoidendElement(String namespaceURI, String localName, String qName) The end of an element.getKey()Returns the key that has been read by the handler, ornull.getValue()Returns the key that has been read by the handler, ornull.voidsetKey(Comparable key) Sets the key.voidSets the value.voidstartElement(String namespaceURI, String localName, String qName, Attributes atts) The start of an element.Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
-
Field Details
-
root
The root handler. -
parent
The parent handler (can be the same as root, but not always). -
key
The key. -
value
The value.
-
-
Constructor Details
-
ItemHandler
Creates a new item handler.- Parameters:
root- the root handler.parent- the parent handler.
-
-
Method Details
-
getKey
Returns the key that has been read by the handler, ornull.- Returns:
- The key.
-
setKey
Sets the key.- Parameters:
key- the key.
-
getValue
Returns the key that has been read by the handler, ornull.- Returns:
- The value.
-
setValue
Sets the value.- Parameters:
value- the value.
-
startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException The start of an element.- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Parameters:
namespaceURI- the namespace.localName- the element name.qName- the element name.atts- the attributes.- Throws:
SAXException- for errors.
-
endElement
The end of an element.- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Parameters:
namespaceURI- the namespace.localName- the element name.qName- the element name.
-