info.bioinfweb.jphyloio.formats.text

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

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

- All Implemented Interfaces:
    JPhyloIOEventReceiver
  Direct Known Subclasses:
    AbstractNexusEventReceiver

      public class BasicTextCommentEventReceiver<P extends TextWriterStreamDataProvider<? extends AbstractTextEventWriter<P>>>
      extends BasicEventReceiver<P>

  Basic event receiver implementation that writes comments to text formats that are delimited by a start and an end string.
  Since:
    0.0.0
  Author:
    Ben Stöver

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasicTextCommentEventReceiver(P streamDataProvider, ReadWriteParameterMap parameterMap, java.lang.String commentStart, java.lang.String commentEnd)` Creates a new instance of this class.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getCommentEnd()`
    `java.lang.String` | `getCommentStart()`
    `protected void` | `handleComment(CommentEvent event)`
    `static void` | `writeComment(BasicEventReceiver<?> receiver, CommentEvent event, java.lang.String commentStart, java.lang.String commentEnd)`

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

      `add, addIgnoredComments, addIgnoredLiteralMetadata, addIgnoredResourceMetadata, addIgnoreLogMessage, didIgnoreComments, didIgnoreLiteralMetadata, didIgnoreMetadata, didIgnoreResourceMetadata, doAdd, 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

    - #### BasicTextCommentEventReceiver

          public BasicTextCommentEventReceiver(P streamDataProvider,
                                               ReadWriteParameterMap parameterMap,
                                               java.lang.String commentStart,
                                               java.lang.String commentEnd)

      Creates a new instance of this class.
      Parameters:
        `writer` - the writer to write data to
        `parameterMap` - the parameter map of the event writer that will be using this receiver instance
        `commentStart` - a string indicating the start of a comment in the target format
        `commentEnd` - a string indicating the end of a comment in the target format

  - ### Method Detail

    - #### getCommentStart

          public java.lang.String getCommentStart()

    - #### getCommentEnd

          public java.lang.String getCommentEnd()

    - #### 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`

    - #### writeComment

          public static void writeComment(BasicEventReceiver<?> receiver,
                                          CommentEvent event,
                                          java.lang.String commentStart,
                                          java.lang.String commentEnd)
                                   throws java.io.IOException

      Throws:
        `java.io.IOException`