CommentEventsCollector

Used by the Composer and Emitter to collect comment events so that they can be used at a later point in the process.

Constructors

Link copied to clipboard
constructor(parser: Parser, vararg expectedCommentTypes: CommentType)

Constructor used to collect comment events emitted by a Parser.

constructor(eventSource: ArrayDeque<Event>, vararg expectedCommentTypes: CommentType)

Constructor used to collect events emitted by the Serializer.

Functions

Link copied to clipboard

Collect all events of the expected type (set during construction) starting with the top event on the event source. Collection stops as soon as a non comment or comment of the unexpected type is encountered.

fun collectEvents(event: Event?): Event?

Collect all events of the expected type (set during construction) starting with event provided as an argument and continuing with the top event on the event source. Collection stops as soon as a non comment or comment of the unexpected type is encountered.

Link copied to clipboard

Collect all events of the expected type (set during construction) starting with event provided as an argument and continuing with the top event on the event source. Collection stops as soon as a non comment or comment of the unexpected type is encountered.

Link copied to clipboard

Return the events collected and reset the collector.

Link copied to clipboard

Test if the collector contains any collected events.