Class EncodingParser<T>

java.lang.Object
io.permazen.cli.parse.EncodingParser<T>
All Implemented Interfaces:
Parser<T>

public class EncodingParser<T> extends Object implements Parser<T>
Parses a value having type supported by an Encoding.
  • Constructor Details

    • EncodingParser

      public EncodingParser(Encoding<T> encoding)
      Constructor.
      Parameters:
      encoding - type to parse
  • Method Details

    • parse

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

      public static EncodingParser<?> getEncodingParser(String typeName)
      Create an instance based on type name.

      Resolution of typeName is deferred until parse time when the database is available.

      Parameters:
      typeName - the name of an Encoding
      Returns:
      parser for the named type