Package org.biojava.bio.program.xff
Class XFFFeatureSetHandler
- java.lang.Object
-
- org.biojava.utils.stax.StAXContentHandlerBase
-
- org.biojava.bio.program.xff.XFFFeatureSetHandler
-
- All Implemented Interfaces:
StAXContentHandler
public class XFFFeatureSetHandler extends StAXContentHandlerBase
StAX handler which converts and stream of parse events for an XFF featureSet element into BioJava SeqIO events. NOTE This class is not thread-safe -- it must only be used for one parse at any time.- Since:
- 1.2
- Author:
- Thomas Down
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROPERTY_XFF_ID
-
Constructor Summary
Constructors Constructor Description XFFFeatureSetHandler()
Construct a new XFFFeatureSetHandler with the default set of handlers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDetailHandler(ElementRecognizer rec, XFFPartHandlerFactory handler)
Extend this FeatureSetHandler to delegate certain detail elements to the specified handler type.void
addFeatureHandler(ElementRecognizer rec, XFFPartHandlerFactory handler)
Extend this FeatureSetHandler to delegate certain feature elements to the specified handler type.void
endElement(String nsURI, String localName, String qName, StAXContentHandler handler)
StAXContentHandlerBase
getDetailsHandler()
Return a handler for the XFFdetails
element.SeqIOListener
getFeatureListener()
Return the object which receives startFeature/endFeature notifications.Annotation
getMergeAnnotation()
void
setFeatureListener(SeqIOListener siol)
Set the object which receives startFeature/endFeature notifications.void
setMergeAnnotation(Annotation ann)
void
startElement(String nsURI, String localName, String qName, Attributes attrs, DelegationManager dm)
-
Methods inherited from class org.biojava.utils.stax.StAXContentHandlerBase
characters, endPrefixMapping, endTree, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping, startTree
-
-
-
-
Field Detail
-
PROPERTY_XFF_ID
public static final String PROPERTY_XFF_ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
XFFFeatureSetHandler
public XFFFeatureSetHandler()
Construct a new XFFFeatureSetHandler with the default set of handlers.
-
-
Method Detail
-
setFeatureListener
public void setFeatureListener(SeqIOListener siol)
Set the object which receives startFeature/endFeature notifications.
-
getFeatureListener
public SeqIOListener getFeatureListener()
Return the object which receives startFeature/endFeature notifications.
-
setMergeAnnotation
public void setMergeAnnotation(Annotation ann)
-
getMergeAnnotation
public Annotation getMergeAnnotation()
-
addFeatureHandler
public void addFeatureHandler(ElementRecognizer rec, XFFPartHandlerFactory handler)
Extend this FeatureSetHandler to delegate certain feature elements to the specified handler type.- Parameters:
rec
- A selector for some sub-set of feature elements.handler
- A factory which returns StAX handlers for matching elements.
-
addDetailHandler
public void addDetailHandler(ElementRecognizer rec, XFFPartHandlerFactory handler)
Extend this FeatureSetHandler to delegate certain detail elements to the specified handler type.- Parameters:
rec
- A selector for some sub-set of detail elements.handler
- A factory which returns StAX handlers for matching elements.
-
startElement
public void startElement(String nsURI, String localName, String qName, Attributes attrs, DelegationManager dm) throws SAXException
- Specified by:
startElement
in interfaceStAXContentHandler
- Overrides:
startElement
in classStAXContentHandlerBase
- Throws:
SAXException
-
endElement
public void endElement(String nsURI, String localName, String qName, StAXContentHandler handler)
- Specified by:
endElement
in interfaceStAXContentHandler
- Overrides:
endElement
in classStAXContentHandlerBase
-
getDetailsHandler
public StAXContentHandlerBase getDetailsHandler()
Return a handler for the XFFdetails
element. This handler will, in turn, delegate to the specific detail handlers provided withaddDetailHandler
-
-