Interface TagValueListener

  • All Known Subinterfaces:
    TagValueWrapper
    All Known Implementing Classes:
    AbstractWrapper, Aggregator, AnnotationBuilder, Echo, Indexer, Indexer2, MultiTagger, RegexFieldFinder, SimpleTagValueWrapper, StateMachine, StateMachine.SimpleStateListener, TagDelegator, TagDropper, TagRenamer, ValueChanger

    public interface TagValueListener

    An object that wishes to be informed of events during the parsing of a file.

    This interface is similar in spirit to the SAX interfaces for parsing XML. Many of the methods will always be called in appropriately nested pairs. Entire records will be bracketed by a startRecord and endRecord pair. Within these, any number of startTag and endTag pairs may be called. Within a tag pair, any number of value invocations may be called. If a value is complex and requires parsing as a sub-entry, then the TagValueContext interface can be used to push a new TagValueParser and listener pair onto the parser stack. This will result in the pushed listener recieving a start/end document notification encapsulating the entire sub-set of events generated by the parser using the pushed TagValueParser to process the sub-document.

    Since:
    1.2
    Author:
    Matthew Pocock
    • Method Detail

      • startTag

        void startTag​(java.lang.Object tag)
               throws ParserException
        Start a new tag.
        Parameters:
        tag - the Object representing the new tag
        Throws:
        ParserException - if the tag could not be started
      • value

        void value​(TagValueContext ctxt,
                   java.lang.Object value)
            throws ParserException
        A value has been seen.
        Parameters:
        ctxt - a TagValueContext that could be used to push a sub-document
        value - the value Object observed
        Throws:
        ParserException - if the value could not be processed