info.bioinfweb.jphyloio.formats.text

## Class TextSequenceContentReceiver<P extends TextWriterStreamDataProvider<? extends AbstractTextEventWriter<P>>>

- java.lang.Object
- - info.bioinfweb.jphyloio.dataadapters.implementations.receivers.BasicEventReceiver<P>
  - - info.bioinfweb.jphyloio.dataadapters.implementations.receivers.AbstractSequenceContentReceiver<P>
    - - info.bioinfweb.jphyloio.formats.text.TextSequenceContentReceiver<P>

- All Implemented Interfaces:
    JPhyloIOEventReceiver

      public class TextSequenceContentReceiver<P extends TextWriterStreamDataProvider<? extends AbstractTextEventWriter<P>>>
      extends AbstractSequenceContentReceiver<P>

  Receiver that writes all encountered sequence tokens and comments to the current line and ignores all metadata. Comments can also be ignored, of `null` is specified as the comment start token.

  It will log an according warning, if comments need to be edited (e.g. because they contain character that are reserved in the target format).

  Since:
    0.0.0
  Author:
    Ben Stöver

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TextSequenceContentReceiver(P streamDataProvider, ReadWriteParameterMap parameterMap, boolean longTokens, java.lang.String commentStart, java.lang.String commentEnd)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `handleComment(CommentEvent event)`
    `protected void` | `handleToken(java.lang.String token, java.lang.String label)` Creates a new instance of this class.

    - ### Methods inherited from class info.bioinfweb.jphyloio.dataadapters.implementations.receivers.AbstractSequenceContentReceiver

      `doAdd, isLongTokens`

    - ### Methods inherited from class info.bioinfweb.jphyloio.dataadapters.implementations.receivers.BasicEventReceiver

      `add, addIgnoredComments, addIgnoredLiteralMetadata, addIgnoredResourceMetadata, addIgnoreLogMessage, didIgnoreComments, didIgnoreLiteralMetadata, didIgnoreMetadata, didIgnoreResourceMetadata, getIgnoredComments, getIgnoredLiteralMetadata, getIgnoredMetadata, getIgnoredResourceMetadata, getLogger, getParameterMap, getParentEvent, getParentEvents, getStreamDataProvider, handleLiteralContentMeta, handleLiteralMetaStart, handleMetaEndEvent, handleResourceMetaStart, isInComment`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TextSequenceContentReceiver

          public TextSequenceContentReceiver(P streamDataProvider,
                                             ReadWriteParameterMap parameterMap,
                                             boolean longTokens,
                                             java.lang.String commentStart,
                                             java.lang.String commentEnd)

  - ### Method Detail

    - #### handleToken

          protected void handleToken(java.lang.String token,
                                     java.lang.String label)
                              throws java.io.IOException

      Creates a new instance of this class.
      Specified by:
        `handleToken` in class `AbstractSequenceContentReceiver<P extends TextWriterStreamDataProvider<? extends AbstractTextEventWriter<P>>>`
      Parameters:
        `writer` - the writer to write the sequence to
        `parameterMap` - the parameter map specified to the calling event writer
        `commentStart` - a comment start token or `null`, if this writer shall ignore comment events
        `commentEnd` - a comment end token or `null`, if this writer shall ignore comment events
        `longTokens` - Specify `true` here if sequence tokens shall be separated by spaces (if one token may be longer than one character) or `false` otherwise.
      Throws:
        `java.io.IOException`

    - #### handleComment

          protected void handleComment(CommentEvent event)
                                throws java.io.IOException,
                                       javax.xml.stream.XMLStreamException

      Overrides:
        `handleComment` in class `BasicEventReceiver<P extends TextWriterStreamDataProvider<? extends AbstractTextEventWriter<P>>>`
      Throws:
        `java.io.IOException`
        `javax.xml.stream.XMLStreamException`