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, startTree
public 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
ParseException
protected void setFeatureProperty(Object key, Object value) throws ChangeVetoException, ParseException
ChangeVetoException
ParseException
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
protected StAXContentHandler getTypeHandler()
protected StAXContentHandler getSourceHandler()
protected StAXContentHandler getOldIDHandler()
protected StAXContentHandler getLocationHandler()
Copyright © 2014 BioJava. All rights reserved.