Class StAXFeatureHandler

    • Field Detail

      • myLocalName

        protected java.lang.String myLocalName
      • startLoc

        protected int startLoc
      • endLoc

        protected int endLoc
      • callbackStack

        protected java.util.List callbackStack
        this is the stack of handler objects for the current feature. The base value is the FeatureHandler itself. your feature and property handlers place and remove themselves from this stack. the purpose of all this is to implement context sensitivty for property handlers translucently. Property handlers can pop the stack for other handlers that implement interfaces that process that element. This way the context code is within the object that defines that context rather than in a child property handler.
      • stackLevel

        protected int stackLevel
      • subFeatures

        protected java.util.List subFeatures
    • Method Detail

      • setHandlerCharacteristics

        public void setHandlerCharacteristics​(java.lang.String localName,
                                              boolean hasCallback)
        Sets the element name that the class responds to.
      • setFeatureListener

        public void setFeatureListener​(SeqIOListener siol)
      • createTemplate

        protected Feature.Template createTemplate()
        generates a very basic Template for the feature with SmallAnnotation in the annotation field.

        Override if you wish a more specialised Template.

      • realizeSubFeatures

        protected void realizeSubFeatures​(Feature feature)
        recursively attach children features to parent
      • addFeatureToSequence

        protected void addFeatureToSequence​(Sequence seq)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getLevel

        protected int getLevel()
        return current stack level. Remember that the stack level is incremented/decremented AFTER the push()/pop() calls and superclass startElement()/StopElement calls.
      • getHandlerStackIterator

        protected java.util.ListIterator getHandlerStackIterator​(int level)
        return iterator to callbackStack
      • push

        protected void push​(StAXContentHandler handler)
        Push StAXContentHandler object onto stack
      • pop

        protected void pop()
        pop a StAXContentHandler off the stack.
      • getFeatureListener

        public SeqIOListener getFeatureListener()
        Return current feature listener
      • setProperty

        protected void setProperty​(java.lang.String name,
                                   java.lang.String value,
                                   boolean forFeature)
      • startElementHandler

        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
        Element-specific handler. Subclass this to do something useful!
        Throws:
        org.xml.sax.SAXException
      • 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
        Handles basic entry processing for all feature handlers.
        Specified by:
        startElement in interface StAXContentHandler
        Overrides:
        startElement in class StAXContentHandlerBase
        Throws:
        org.xml.sax.SAXException
      • endElementHandler

        public void endElementHandler​(java.lang.String nsURI,
                                      java.lang.String localName,
                                      java.lang.String qName,
                                      StAXContentHandler handler)
                               throws org.xml.sax.SAXException
        Element specific exit handler Subclass to do anything useful.
        Throws:
        org.xml.sax.SAXException