Home Original page

AbstractWrapper (biojava-legacy 1.9.5 API)

  • java.lang.Object
    • org.biojava.bio.program.tagvalue.AbstractWrapper
  • All Implemented Interfaces:
    TagValueListener, TagValueWrapper

    public class AbstractWrapper
    extends Object
    implements TagValueWrapper

    An abstract TagValueWrapper that does nothing!

    Useful for writing TagValueWrappers which only act on a subset of the events.

    Author:
    David Huen
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractWrapper()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void endRecord()

      The current record has ended.

      void endTag()

      End the current tag.

      TagValueListener getDelegate()

      get listener to which all calls will be delegated

      void setDelegate​(TagValueListener delegate)

      set listener to which all calls will be delegated

      void startRecord()

      A new record is about to start.

      void startTag​(Object tag)

      Start a new tag.

      void value​(TagValueContext ctxt, Object value)

      A value has been seen.

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractWrapper

        public AbstractWrapper()
    • Method Detail

      • setDelegate

        public void setDelegate​(TagValueListener delegate)

        set listener to which all calls will be delegated

        Specified by:
        setDelegate in interface TagValueWrapper
      • getDelegate

        public TagValueListener getDelegate()

        get listener to which all calls will be delegated

        Specified by:
        getDelegate in interface TagValueWrapper
      • startRecord

        public void startRecord()
                         throws ParserException

        A new record is about to start.

        Specified by:
        startRecord in interface TagValueListener
        Throws:
        ParserException - if the record can not be started
      • startTag

        public void startTag​(Object tag)
                      throws ParserException

        Start a new tag.

        Specified by:
        startTag in interface TagValueListener
        Parameters:
        tag - the Object representing the new tag
        Throws:
        ParserException - if the tag could not be started
      • endTag

        public void endTag()
                    throws ParserException

        End the current tag.

        Specified by:
        endTag in interface TagValueListener
        Throws:
        ParserException - if the tag could not be ended
      • endRecord

        public void endRecord()
                       throws ParserException

        The current record has ended.

        Specified by:
        endRecord in interface TagValueListener
        Throws:
        ParserException - if the record can not be ended
      • value

        public void value​(TagValueContext ctxt,
                          Object value)
                   throws ParserException

        A value has been seen.

        Specified by:
        value in interface TagValueListener
        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