Class WordParser

java.lang.Object
io.permazen.cli.parse.WordParser
All Implemented Interfaces:
Parser<String>

public class WordParser extends Object implements Parser<String>
Parses a word (one or more characters).
  • Constructor Details

  • Method Details

    • getWords

      protected Collection<String> getWords()
      Get the set of valid words, if there is such a set.

      The implementation in WordParser returns the collection provided to the constructor, if any.

      Returns:
      collection of valid words, or null to not place any restriction
    • parse

      public String parse(Session session, String text)
      Description copied from interface: Parser
      Parse value from the given text.
      Specified by:
      parse in interface Parser<String>
      Parameters:
      session - CLI session
      text - input to parse
      Returns:
      parsed value