Class StringParser

  • All Implemented Interfaces:
    Parser<java.lang.String>

    public class StringParser
    extends java.lang.Object
    implements Parser<java.lang.String>
    • Constructor Summary

      Constructors 
      Constructor Description
      StringParser()
      Create a string parser in which all whitespace is included in the value.
      StringParser​(boolean trim)
      Create a string parser with the option of trimming leading and ending whitespace.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String parse​(java.lang.String input)
      Convert a string into an object of the desired type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StringParser

        public StringParser()
        Create a string parser in which all whitespace is included in the value.
      • StringParser

        public StringParser​(boolean trim)
        Create a string parser with the option of trimming leading and ending whitespace.
        Parameters:
        trim - should whitespace be trimmed?
    • Method Detail

      • parse

        public java.lang.String parse​(java.lang.String input)
        Convert a string into an object of the desired type.
        Specified by:
        parse in interface Parser<java.lang.String>
        Parameters:
        input - input string
        Returns:
        value of the desired type