Package org.biojavax.bio.phylo.io.nexus
Class NexusFileListener.Abstract
java.lang.Object
org.biojavax.bio.phylo.io.nexus.NexusFileListener.Abstract
- All Implemented Interfaces:
NexusFileListener
- Direct Known Subclasses:
NexusFileBuilder
- Enclosing interface:
- NexusFileListener
Example abstract implementation which all others should extend.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.biojavax.bio.phylo.io.nexus.NexusFileListener
NexusFileListener.Abstract -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidOpening a comment tag.protected abstract voidThis method will get called when a comment is started on the file, and not any block within it.protected abstract voidblockEnded(NexusBlockParser blockParser) This method gets called when the block parser is expected to have finished parsing a block.voidcommentText(String comment) Receiving free text inside a comment tag.voidendBlock()Finished reading a block.voidClosing a comment tag.protected abstract voidThis method will get called when a comment is ended on the file, and not any block within it.voidClosing a line (semi-colon encountered).protected abstract voidfileCommentText(String comment) This method will get called when comment text is found on the file, and not any block within it.getBlockParser(String blockName) Gets the parser to use for a given block.voidparseToken(String token) Encountered a token.voidsetBlockParser(String blockName, NexusBlockParser parser) Sets the parser to use for a given block.voidCauses the default block parsers to be assigned.voidstartBlock(String blockName) About to start a new block.booleanDoes the listener want to know about brackets and braces as separate tokens?Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.biojavax.bio.phylo.io.nexus.NexusFileListener
endFile, startFile
-
Constructor Details
-
Abstract
public Abstract()
-
-
Method Details
-
beginComment
Description copied from interface:NexusFileListenerOpening a comment tag.- Specified by:
beginCommentin interfaceNexusFileListener
-
beginFileComment
This method will get called when a comment is started on the file, and not any block within it. -
commentText
Description copied from interface:NexusFileListenerReceiving free text inside a comment tag.- Specified by:
commentTextin interfaceNexusFileListener- Parameters:
comment- the text of the comment.- Throws:
ParseException
-
fileCommentText
This method will get called when comment text is found on the file, and not any block within it.- Parameters:
comment- the comment text.
-
endComment
Description copied from interface:NexusFileListenerClosing a comment tag.- Specified by:
endCommentin interfaceNexusFileListener
-
endFileComment
This method will get called when a comment is ended on the file, and not any block within it. -
endBlock
Description copied from interface:NexusFileListenerFinished reading a block.- Specified by:
endBlockin interfaceNexusFileListener
-
blockEnded
This method gets called when the block parser is expected to have finished parsing a block.- Parameters:
blockParser- the parser that has finished.
-
wantsBracketsAndBraces
Description copied from interface:NexusFileListenerDoes the listener want to know about brackets and braces as separate tokens?- Specified by:
wantsBracketsAndBracesin interfaceNexusFileListener- Returns:
- true if it does.
-
setDefaultBlockParsers
Description copied from interface:NexusFileListenerCauses 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.- Specified by:
setDefaultBlockParsersin interfaceNexusFileListener
-
getBlockParser
Description copied from interface:NexusFileListenerGets the parser to use for a given block.- Specified by:
getBlockParserin interfaceNexusFileListener- Parameters:
blockName- the name of the block. return parser the parser to use. Is never null.
-
endTokenGroup
Description copied from interface:NexusFileListenerClosing a line (semi-colon encountered). This indicates that anything received after it is on the next logical line of the file.- Specified by:
endTokenGroupin interfaceNexusFileListener
-
parseToken
Description copied from interface:NexusFileListenerEncountered a token.- Specified by:
parseTokenin interfaceNexusFileListener- Parameters:
token- the token.- Throws:
ParseException- if the token is invalid.
-
setBlockParser
Description copied from interface:NexusFileListenerSets the parser to use for a given block.- Specified by:
setBlockParserin interfaceNexusFileListener- 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.
-
startBlock
Description copied from interface:NexusFileListenerAbout to start a new block.- Specified by:
startBlockin interfaceNexusFileListener- Parameters:
blockName- the name of the new block.
-