public abstract class BooleanElementHandlerBase extends StAXContentHandlerBase
StAX handler for any element which just contains a string representation of an boolean.
This calss collects the string data, and when it is complete, passes it to the (abstract) setBooleanValue method. Typical use of this class is as a base for a small (often anonymous) class which takes the boolean value and stores it in some variable.
Constructor and Description |
---|
BooleanElementHandlerBase() |
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int end)
Signal a span of character data in the XML input.
|
void |
endElement(String nsURI,
String localName,
String qName,
StAXContentHandler handler) |
protected abstract void |
setBooleanValue(boolean val)
Override this method to do something useful with the
boolean we collect.
|
void |
startElement(String nsURI,
String localName,
String qName,
Attributes attrs,
DelegationManager dm) |
endPrefixMapping, endTree, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping, startTree
public BooleanElementHandlerBase()
public void startElement(String nsURI, String localName, String qName, Attributes attrs, DelegationManager dm) throws SAXException
startElement
in interface StAXContentHandler
startElement
in class StAXContentHandlerBase
SAXException
public void endElement(String nsURI, String localName, String qName, StAXContentHandler handler) throws SAXException
endElement
in interface StAXContentHandler
endElement
in class StAXContentHandlerBase
SAXException
public void characters(char[] ch, int start, int end) throws SAXException
StAXContentHandlerBase
characters
in interface StAXContentHandler
characters
in class StAXContentHandlerBase
ch
- an array of charactersstart
- index of the first significant character for this event.end
- number of characters significant to this event.SAXException
protected abstract void setBooleanValue(boolean val) throws SAXException
Override this method to do something useful with the boolean we collect.
This method will be invoked by endElement with the fully parsed boolean.
val
- the fully parsed booleanSAXException
- if for any reason the boolean is not palatableCopyright © 2014 BioJava. All rights reserved.