public abstract static class NexusFileListener.Abstract extends Object implements NexusFileListener
NexusFileListener.Abstract
Constructor and Description |
---|
NexusFileListener.Abstract() |
Modifier and Type | Method and Description |
---|---|
void |
beginComment()
Opening a comment tag.
|
protected abstract void |
beginFileComment()
This method will get called when a comment is started on the file,
and not any block within it.
|
protected abstract void |
blockEnded(NexusBlockParser blockParser)
This method gets called when the block parser is expected to have
finished parsing a block.
|
void |
commentText(String comment)
Receiving free text inside a comment tag.
|
void |
endBlock()
Finished reading a block.
|
void |
endComment()
Closing a comment tag.
|
protected abstract void |
endFileComment()
This method will get called when a comment is ended on the file, and
not any block within it.
|
void |
endTokenGroup()
Closing a line (semi-colon encountered).
|
protected abstract void |
fileCommentText(String comment)
This method will get called when comment text is found on the file,
and not any block within it.
|
NexusBlockParser |
getBlockParser(String blockName)
Gets the parser to use for a given block.
|
void |
parseToken(String token)
Encountered a token.
|
void |
setBlockParser(String blockName,
NexusBlockParser parser)
Sets the parser to use for a given block.
|
void |
setDefaultBlockParsers()
Causes the default block parsers to be assigned.
|
void |
startBlock(String blockName)
About to start a new block.
|
boolean |
wantsBracketsAndBraces()
Does the listener want to know about brackets and braces as separate
tokens?
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
endFile, startFile
public NexusFileListener.Abstract()
public void beginComment()
NexusFileListener
beginComment
in interface NexusFileListener
protected abstract void beginFileComment()
public void commentText(String comment) throws ParseException
NexusFileListener
commentText
in interface NexusFileListener
comment
- the text of the comment.ParseException
protected abstract void fileCommentText(String comment)
comment
- the comment text.public void endComment()
NexusFileListener
endComment
in interface NexusFileListener
protected abstract void endFileComment()
public void endBlock()
NexusFileListener
endBlock
in interface NexusFileListener
protected abstract void blockEnded(NexusBlockParser blockParser)
blockParser
- the parser that has finished.public boolean wantsBracketsAndBraces()
NexusFileListener
wantsBracketsAndBraces
in interface NexusFileListener
public void setDefaultBlockParsers()
NexusFileListener
setDefaultBlockParsers
in interface NexusFileListener
public NexusBlockParser getBlockParser(String blockName)
NexusFileListener
getBlockParser
in interface NexusFileListener
blockName
- the name of the block. return parser the parser to use. Is
never null.public void endTokenGroup()
NexusFileListener
endTokenGroup
in interface NexusFileListener
public void parseToken(String token) throws ParseException
NexusFileListener
parseToken
in interface NexusFileListener
token
- the token.ParseException
- if the token is invalid.public void setBlockParser(String blockName, NexusBlockParser parser)
NexusFileListener
setBlockParser
in interface NexusFileListener
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.public void startBlock(String blockName)
NexusFileListener
startBlock
in interface NexusFileListener
blockName
- the name of the new block.Copyright © 2014 BioJava. All rights reserved.