public abstract class AbstractNexusSetsEventReceiver extends AbstractNexusEventReceiver
ALTERNATIVE_END_COMMAND, BEGIN_COMMAND, BLOCK_NAME_CHARACTERS, BLOCK_NAME_DATA, BLOCK_NAME_NETWORKS, BLOCK_NAME_SETS, BLOCK_NAME_TAXA, BLOCK_NAME_TREES, BLOCK_NAME_UNALIGNED, CHARACTER_NAME_STATES_SEPARATOR, COMMAND_END, COMMAND_NAME_CHAR_LABELS, COMMAND_NAME_CHAR_SET, COMMAND_NAME_CHAR_STATE_LABELS, COMMAND_NAME_DIMENSIONS, COMMAND_NAME_FORMAT, COMMAND_NAME_LINK, COMMAND_NAME_MATRIX, COMMAND_NAME_NETWORK, COMMAND_NAME_TAX_LABELS, COMMAND_NAME_TAXON_SET, COMMAND_NAME_TITLE, COMMAND_NAME_TRANSLATE, COMMAND_NAME_TREE, COMMAND_NAME_TREE_SET, COMMENT_END, COMMENT_START, DIMENSIONS_SUBCOMMAND_NCHAR, DIMENSIONS_SUBCOMMAND_NEW_TAXA, DIMENSIONS_SUBCOMMAND_NTAX, ELEMENT_SEPARATOR, END_COMMAND, FIRST_LINE, FORMAT_NAME_STANDARD, FORMAT_NAME_VECTOR, FORMAT_SUBCOMMAND_DATA_TYPE, FORMAT_SUBCOMMAND_GAP_CHAR, FORMAT_SUBCOMMAND_INTERLEAVE, FORMAT_SUBCOMMAND_MATCH_CHAR, FORMAT_SUBCOMMAND_MISSING_CHAR, FORMAT_SUBCOMMAND_NO_LABELS, FORMAT_SUBCOMMAND_NO_TOKENS, FORMAT_SUBCOMMAND_SYMBOLS, FORMAT_SUBCOMMAND_TOKENS, FORMAT_SUBCOMMAND_TRANSPOSE, FORMAT_VALUE_CONTINUOUS_DATA_TYPE, FORMAT_VALUE_DNA_DATA_TYPE, FORMAT_VALUE_MIXED_DATA_TYPE, FORMAT_VALUE_NUCLEOTIDE_DATA_TYPE, FORMAT_VALUE_PROTEIN_DATA_TYPE, FORMAT_VALUE_RNA_DATA_TYPE, FORMAT_VALUE_STANDARD_DATA_TYPE, KEY_VALUE_SEPARATOR, MATRIX_POLYMORPHIC_TOKEN_END, MATRIX_POLYMORPHIC_TOKEN_START, MATRIX_UNCERTAINS_TOKEN_END, MATRIX_UNCERTAINS_TOKEN_START, NEXUS_FORMAT_NAME, NEXUS_NAMESPACE_PREFIX, NEXUS_PREDICATE_NAMESPACE, SET_END_INDEX_SYMBOL, SET_KEY_WORD_ALL, SET_KEY_WORD_REMAINING, SET_REGULAR_INTERVAL_SYMBOL, SET_TO_SYMBOL, SET_VECTOR_CONTAINED, SET_VECTOR_NOT_CONTAINED, UNTIL_WHITESPACE_COMMENT_COMMAND_EQUAL_PATTERN, UNTIL_WHITESPACE_COMMENT_COMMAND_PATTERN, VALUE_DELIMITER, WORD_DELIMITER
Constructor and Description |
---|
AbstractNexusSetsEventReceiver(NexusWriterStreamDataProvider streamDataProvider)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
doAdd(JPhyloIOEvent event)
This method is called internally by
BasicEventReceiver.add(JPhyloIOEvent) to process events that do not model metadata or
comments. |
protected boolean |
handleCharacterSetInterval(CharacterSetIntervalEvent event)
This method is called every time a
CharacterSetIntervalEvent is encountered on the top level by
this receiver. |
protected abstract boolean |
handleSetElement(SetElementEvent event)
This method is called every time a
SetElementEvent is encountered on the top level by
this receiver and must be implemented by inherited classes. |
protected void |
writeElementReference(SetElementEvent event) |
getCommentEnd, getCommentStart, handleComment, writeComment
add, addIgnoredComments, addIgnoredLiteralMetadata, addIgnoredResourceMetadata, addIgnoreLogMessage, didIgnoreComments, didIgnoreLiteralMetadata, didIgnoreMetadata, didIgnoreResourceMetadata, getIgnoredComments, getIgnoredLiteralMetadata, getIgnoredMetadata, getIgnoredResourceMetadata, getLogger, getParameterMap, getParentEvent, getParentEvents, getStreamDataProvider, handleLiteralContentMeta, handleLiteralMetaStart, handleMetaEndEvent, handleResourceMetaStart, isInComment
public AbstractNexusSetsEventReceiver(NexusWriterStreamDataProvider streamDataProvider)
streamDataProvider
- the stream data provider of the calling NexusEventWriter
.protected boolean handleCharacterSetInterval(CharacterSetIntervalEvent event) throws java.io.IOException
CharacterSetIntervalEvent
is encountered on the top level by
this receiver.
This default implementation always returns false
that leads to an IllegalEventException
.
Inherited classes that support CharacterSetIntervalEvent
s should overwrite this method.
event
- the character set interval event that was encountered on the top level by this receivertrue
if the encountered event is legal at this position or false
otherwisejava.io.IOException
- if an I/O error occurs while trying to write the contents of the event (This cannot
happen in this default implementation, but may happen in overwritten implementations.)protected abstract boolean handleSetElement(SetElementEvent event) throws java.io.IOException
SetElementEvent
is encountered on the top level by
this receiver and must be implemented by inherited classes.event
- the set element event that was encountered on the top level by this receivertrue
if the encountered event is legal at this position or false
otherwise
(If false
is returned by inherited classes, an IllegalEventException
will
be thrown as a result afterwards.)java.io.IOException
- if an I/O error occurs while trying to write the contents of the eventprotected void writeElementReference(SetElementEvent event) throws java.io.IOException
java.io.IOException
protected boolean doAdd(JPhyloIOEvent event) throws java.io.IOException, javax.xml.stream.XMLStreamException
BasicEventReceiver
BasicEventReceiver.add(JPhyloIOEvent)
to process events that do not model metadata or
comments. (Such events are treated by the according special methods of this class).
This default implementation just throws an IllegalEventException
. Inherited classes that need to support other
events then these modeling metadata or comments, must overwrite this method.
doAdd
in class BasicEventReceiver<NexusWriterStreamDataProvider>
event
- the event to be processedtrue
if more events can be written to this acceptor or false
if writing should
be abortedjava.io.IOException
- if an I/O error occurs when writing to the underlying streamjavax.xml.stream.XMLStreamException
- if an XML stream error occurs when writing to the underlying stream