public class StAXFeatureHandler extends StAXContentHandlerBase
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)
Modifier and Type | Field and Description |
---|---|
protected SimpleAnnotation |
annot |
protected List |
callbackStack
this is the stack of handler objects for the current feature.
|
protected int |
endLoc |
protected SeqIOListener |
featureListener |
protected Feature.Template |
featureTemplate |
protected String |
myLocalName |
protected int |
stackLevel |
protected int |
startLoc |
protected StAXFeatureHandler |
staxenv |
protected List |
subFeatures |
Modifier and Type | Method and Description |
---|---|
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(String nsURI,
String localName,
String qName,
StAXContentHandler handler)
Handles basic exit processing.
|
void |
endElementHandler(String nsURI,
String localName,
String qName,
StAXContentHandler handler)
Element specific exit handler
Subclass to do anything useful.
|
SeqIOListener |
getFeatureListener()
Return current feature listener
|
protected 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(String localName,
boolean hasCallback)
Sets the element name that the class responds to.
|
protected void |
setProperty(String name,
String value,
boolean forFeature) |
void |
startElement(String nsURI,
String localName,
String qName,
Attributes attrs,
DelegationManager dm)
Handles basic entry processing for all feature handlers.
|
void |
startElementHandler(String nsURI,
String localName,
String qName,
Attributes attrs)
Element-specific handler.
|
characters, endPrefixMapping, endTree, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping, startTree
protected String myLocalName
protected Feature.Template featureTemplate
protected StAXFeatureHandler staxenv
protected SeqIOListener featureListener
protected int startLoc
protected int endLoc
protected List callbackStack
protected int stackLevel
protected List subFeatures
protected SimpleAnnotation annot
public void setHandlerCharacteristics(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 Exception
Exception
protected int getLevel()
protected ListIterator getHandlerStackIterator(int level)
protected void push(StAXContentHandler handler)
protected void pop()
public SeqIOListener getFeatureListener()
protected void setProperty(String name, String value, boolean forFeature)
public void startElementHandler(String nsURI, String localName, String qName, Attributes attrs) throws SAXException
SAXException
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 endElementHandler(String nsURI, String localName, String qName, StAXContentHandler handler) throws SAXException
SAXException
public void endElement(String nsURI, String localName, String qName, StAXContentHandler handler) throws SAXException
endElement
in interface StAXContentHandler
endElement
in class StAXContentHandlerBase
SAXException
Copyright © 2014 BioJava. All rights reserved.