org.biojava.bio.program.xff
Class XFFFeatureSetHandler

java.lang.Object
  extended by org.biojava.utils.stax.StAXContentHandlerBase
      extended by 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
static java.lang.String PROPERTY_XFF_ID
           
 
Constructor Summary
XFFFeatureSetHandler()
          Construct a new XFFFeatureSetHandler with the default set of handlers.
 
Method Summary
 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(java.lang.String nsURI, java.lang.String localName, java.lang.String qName, StAXContentHandler handler)
           
 StAXContentHandlerBase getDetailsHandler()
          Return a handler for the XFF details 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(java.lang.String nsURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs, DelegationManager dm)
           
 
Methods inherited from class org.biojava.utils.stax.StAXContentHandlerBase
characters, endPrefixMapping, endTree, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping, startTree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_XFF_ID

public static final java.lang.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(java.lang.String nsURI,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attrs,
                         DelegationManager dm)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface StAXContentHandler
Overrides:
startElement in class StAXContentHandlerBase
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String nsURI,
                       java.lang.String localName,
                       java.lang.String qName,
                       StAXContentHandler handler)
Specified by:
endElement in interface StAXContentHandler
Overrides:
endElement in class StAXContentHandlerBase

getDetailsHandler

public StAXContentHandlerBase getDetailsHandler()
Return a handler for the XFF details element. This handler will, in turn, delegate to the specific detail handlers provided with addDetailHandler