|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.bio.seq.io.agave.StAXContentHandlerBase
org.biojava.bio.seq.io.agave.StAXFeatureHandler
StAX handler shamelessly ripped off from Thomas Down's XFFFeatureSetHandler. It was modified for greater generality. NOTE This class is not thread-safe -- it must only be used for one parse at any time.
Because AGAVE has nested feature and each feature must attached to some parent feature-holder in biojava, which means we need to generate parents first, so we have to keep the tree structure of features in memory, which is really bad. anyway, we still saved a lot of memory compared with DOM tree . Hanning Ni)
Field Summary | |
protected SimpleAnnotation |
annot
|
protected java.util.List |
callbackStack
this is the stack of handler objects for the current feature. |
protected int |
endLoc
|
protected SeqIOListener |
featureListener
|
protected Feature.Template |
featureTemplate
|
protected java.lang.String |
myLocalName
|
protected int |
stackLevel
|
protected int |
startLoc
|
protected StAXFeatureHandler |
staxenv
|
protected java.util.List |
subFeatures
|
Method Summary | |
protected void |
addFeatureToSequence(Sequence seq)
|
protected void |
addHandler(ElementRecognizer rec,
StAXHandlerFactory handler)
|
protected Feature.Template |
createTemplate()
generates a very basic Template for the feature with SmallAnnotation in the annotation field. |
void |
endElement(java.lang.String nsURI,
java.lang.String localName,
java.lang.String qName,
StAXContentHandler handler)
Handles basic exit processing. |
void |
endElementHandler(java.lang.String nsURI,
java.lang.String localName,
java.lang.String qName,
StAXContentHandler handler)
Element specific exit handler Subclass to do anything useful. |
SeqIOListener |
getFeatureListener()
Return current feature listener |
protected java.util.ListIterator |
getHandlerStackIterator(int level)
return iterator to callbackStack |
protected int |
getLevel()
return current stack level. |
protected void |
pop()
pop a StAXContentHandler off the stack. |
protected void |
push(StAXContentHandler handler)
Push StAXContentHandler object onto stack |
protected void |
realizeSubFeatures(Feature feature)
recursively attach children features to parent |
void |
setFeatureListener(SeqIOListener siol)
|
void |
setHandlerCharacteristics(java.lang.String localName,
boolean hasCallback)
Sets the element name that the class responds to. |
protected void |
setProperty(java.lang.String name,
java.lang.String value,
boolean forFeature)
|
void |
startElement(java.lang.String nsURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attrs,
DelegationManager dm)
Handles basic entry processing for all feature handlers. |
void |
startElementHandler(java.lang.String nsURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attrs)
Element-specific handler. |
Methods inherited from class org.biojava.bio.seq.io.agave.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 |
protected java.lang.String myLocalName
protected Feature.Template featureTemplate
protected StAXFeatureHandler staxenv
protected SeqIOListener featureListener
protected int startLoc
protected int endLoc
protected java.util.List callbackStack
protected int stackLevel
protected java.util.List subFeatures
protected SimpleAnnotation annot
Method Detail |
public void setHandlerCharacteristics(java.lang.String localName, boolean hasCallback)
public void setFeatureListener(SeqIOListener siol)
protected void addHandler(ElementRecognizer rec, StAXHandlerFactory handler)
protected Feature.Template createTemplate()
Override if you wish a more specialised Template.
protected void realizeSubFeatures(Feature feature)
protected void addFeatureToSequence(Sequence seq) throws java.lang.Exception
java.lang.Exception
protected int getLevel()
protected java.util.ListIterator getHandlerStackIterator(int level)
protected void push(StAXContentHandler handler)
protected void pop()
public SeqIOListener getFeatureListener()
protected void setProperty(java.lang.String name, java.lang.String value, boolean forFeature)
public void startElementHandler(java.lang.String nsURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
org.xml.sax.SAXException
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
startElement
in interface StAXContentHandler
startElement
in class StAXContentHandlerBase
org.xml.sax.SAXException
public void endElementHandler(java.lang.String nsURI, java.lang.String localName, java.lang.String qName, StAXContentHandler handler) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void endElement(java.lang.String nsURI, java.lang.String localName, java.lang.String qName, StAXContentHandler handler) throws org.xml.sax.SAXException
endElement
in interface StAXContentHandler
endElement
in class StAXContentHandlerBase
org.xml.sax.SAXException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |