public class FeatureHandler extends StAXContentHandlerBase
feature type of XFF.
This class can also be subclassed to handle other XFF types.
In general, to handle a feature subclass, you will
with to:
startElement and endElement
methods which handle extra extra elements in your feature type. These
should normally pass on all the standard elements to
super.startElement and super.endElement.
Note that, since FeatureHandler does some basic housekeeping,
if you `consume' a startElement notification (i.e. don't pass it on to the
superclass) you must also consume the matching endElement. Since FeatureHandler
silently ignores all unrecognized elements, it is usually safe to pass on
all startElement and endElement notifications -- even those which are specific
to your feature type.
| Modifier and Type | Field and Description |
|---|---|
static XFFPartHandlerFactory |
FEATURE_HANDLER_FACTORY |
| Constructor and Description |
|---|
FeatureHandler(XFFFeatureSetHandler xffenv)
Construct a new Feature handler, passing in an XFF-parsing environment.
|
| Modifier and Type | Method and Description |
|---|---|
protected Feature.Template |
createFeatureTemplate()
Create a new template of the appropriate type.
|
void |
endElement(String nsURI,
String localName,
String qName,
StAXContentHandler handler)
StAX callback for element ends.
|
protected void |
fireEndFeature()
Fire the endFeature event.
|
protected void |
fireStartFeature()
Fire the startFeature event.
|
protected Feature.Template |
getFeatureTemplate()
Get the template for the feature being constructed.
|
protected StAXContentHandler |
getLocationHandler() |
protected StAXContentHandler |
getOldIDHandler() |
protected StAXContentHandler |
getSourceHandler() |
protected StAXContentHandler |
getTypeHandler() |
XFFFeatureSetHandler |
getXFFEnvironment()
Return the XFF processing environment passed in when this handler was
created.
|
protected void |
setFeatureProperty(Object key,
Object value)
Set a property.
|
void |
startElement(String nsURI,
String localName,
String qName,
Attributes attrs,
DelegationManager dm)
StAX callback for element starts.
|
characters, endPrefixMapping, endTree, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping, startTreepublic static final XFFPartHandlerFactory FEATURE_HANDLER_FACTORY
public FeatureHandler(XFFFeatureSetHandler xffenv)
public XFFFeatureSetHandler getXFFEnvironment()
protected Feature.Template getFeatureTemplate()
createFeatureTemplate
for template construction.protected Feature.Template createFeatureTemplate()
protected void fireStartFeature() throws ParseException
ParseException - if the startFeature notification fails, or if
it has already been made.protected void fireEndFeature() throws ParseException
ParseExceptionprotected void setFeatureProperty(Object key, Object value) throws ChangeVetoException, ParseException
ChangeVetoExceptionParseExceptionpublic void startElement(String nsURI, String localName, String qName, Attributes attrs, DelegationManager dm) throws SAXException
startElement in interface StAXContentHandlerstartElement in class StAXContentHandlerBaseSAXExceptionpublic void endElement(String nsURI, String localName, String qName, StAXContentHandler handler) throws SAXException
endElement in interface StAXContentHandlerendElement in class StAXContentHandlerBaseSAXExceptionprotected StAXContentHandler getTypeHandler()
protected StAXContentHandler getSourceHandler()
protected StAXContentHandler getOldIDHandler()
protected StAXContentHandler getLocationHandler()
Copyright © 2014 BioJava. All rights reserved.