Interface Parser

  • All Superinterfaces:
    Iterator<org.snakeyaml.engine.v2.events.Event>
    All Known Implementing Classes:
    ParserImpl

    public interface Parser
    extends Iterator<org.snakeyaml.engine.v2.events.Event>
    This interface represents an input stream of Events.

    The parser and the scanner form together the 'Parse' step in the loading process.

    See Also:
    Figure 3.1. Processing Overview
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean checkEvent​(org.snakeyaml.engine.v2.events.Event.ID choice)
      Check if the next event is one of the given type.
      org.snakeyaml.engine.v2.events.Event next()
      Returns the next event.
      org.snakeyaml.engine.v2.events.Event peekEvent()
      Return the next event, but do not delete it from the stream.
    • Method Detail

      • checkEvent

        boolean checkEvent​(org.snakeyaml.engine.v2.events.Event.ID choice)
        Check if the next event is one of the given type.
        Parameters:
        choice - Event ID to match
        Returns:
        true if the next event has the given ID, false otherwise.
        Throws:
        ParserException - in case of malformed input.
        NoSuchElementException - in case no next event is available.
      • peekEvent

        org.snakeyaml.engine.v2.events.Event peekEvent()
        Return the next event, but do not delete it from the stream.
        Returns:
        The event that will be returned on the next call to next()
        Throws:
        ParserException - in case of malformed input
        NoSuchElementException - in case no next event is available.
      • next

        org.snakeyaml.engine.v2.events.Event next()
        Returns the next event.

        The event will be removed from the stream.

        Specified by:
        next in interface Iterator<org.snakeyaml.engine.v2.events.Event>
        Returns:
        the next parsed event
        Throws:
        ParserException - in case of malformed input.
        NoSuchElementException - in case no next event is available.