Interface NexusFileListener

All Known Implementing Classes:
NexusFileBuilder, NexusFileListener.Abstract

public interface NexusFileListener
Listens to events fired by the Nexus parser. Use these events to handle data directly or construct objects.
Since:
1.6
Author:
Richard Holland, Tobias Thierer, Jim Balhoff
  • Method Details

    • startFile

      void startFile()
      About to start a new file.
    • endFile

      void endFile()
      Finished reading a file.
    • beginComment

      void beginComment()
      Opening a comment tag.
    • commentText

      void commentText(String comment) throws ParseException
      Receiving free text inside a comment tag.
      Parameters:
      comment - the text of the comment.
      Throws:
      ParseException
    • endComment

      void endComment()
      Closing a comment tag.
    • endTokenGroup

      Closing a line (semi-colon encountered). This indicates that anything received after it is on the next logical line of the file.
    • setDefaultBlockParsers

      Causes the default block parsers to be assigned. This is called by the constructor of the abstract implementation. If it is not called, then at least the unknown block parser must be set by other means.
    • setBlockParser

      void setBlockParser(String blockName, NexusBlockParser parser)
      Sets the parser to use for a given block.
      Parameters:
      blockName - the name of the block.
      parser - the parser to use. Use null to unset an existing one and use the default one for that block instead.
    • getBlockParser

      Gets the parser to use for a given block.
      Parameters:
      blockName - the name of the block. return parser the parser to use. Is never null.
    • startBlock

      void startBlock(String blockName)
      About to start a new block.
      Parameters:
      blockName - the name of the new block.
    • endBlock

      void endBlock()
      Finished reading a block.
    • parseToken

      void parseToken(String token) throws ParseException
      Encountered a token.
      Parameters:
      token - the token.
      Throws:
      ParseException - if the token is invalid.
    • wantsBracketsAndBraces

      Does the listener want to know about brackets and braces as separate tokens?
      Returns:
      true if it does.