001/* 002 * BioJava development code 003 * 004 * This code may be freely distributed and modified under the 005 * terms of the GNU Lesser General Public Licence. This should 006 * be distributed with the code. If you do not have a copy, 007 * see: 008 * 009 * http://www.gnu.org/copyleft/lesser.html 010 * 011 * Copyright for this code is held jointly by the individual 012 * authors. These should be listed in @author doc comments. 013 * 014 * For more information on the BioJava project and its aims, 015 * or to join the biojava-l mailing list, visit the home page 016 * at: 017 * 018 * http://www.biojava.org/ 019 * 020 */ 021package org.biojavax.bio.phylo.io.nexus; 022 023import org.biojava.bio.seq.io.ParseException; 024 025/** 026 * Listens to events from NexusBlockParser objects to create objects. This empty 027 * interface needs to be implemented/extended for each block type supported. 028 * 029 * @author Richard Holland 030 * @author Tobias Thierer 031 * @author Jim Balhoff 032 * @since 1.6 033 */ 034public interface NexusBlockListener { 035 036 /** 037 * Notifies the parser that a new block is starting. 038 * 039 * @param blockName 040 * the name of the newly started block. 041 */ 042 public void startBlock(String blockName); 043 044 /** 045 * Notifies the parser that a block is ending. 046 */ 047 public void endBlock(); 048 049 /** 050 * Opening a comment tag. 051 */ 052 public void beginComment(); 053 054 /** 055 * Closing a comment tag. 056 */ 057 public void endComment(); 058 059 /** 060 * Closing a line (semi-colon encountered). This indicates that anything 061 * received after it is on the next logical line of the block. 062 */ 063 public void endTokenGroup(); 064 065 /** 066 * Receiving free text inside a comment tag. 067 * 068 * @param comment 069 * the text of the comment. 070 */ 071 public void commentText(String comment) throws ParseException; 072}