Class StringParser<T>

  • All Implemented Interfaces:
    Parser<T>

    public class StringParser<T>
    extends Object
    implements Parser<T>
    • Constructor Detail

      • StringParser

        public StringParser()
      • StringParser

        public StringParser​(boolean caseSensitive)
      • StringParser

        public StringParser​(boolean caseSensitive,
                            StringConverter<T> converter)
    • Method Detail

      • isCaseSensitive

        public boolean isCaseSensitive()
      • setCaseSensitive

        public void setCaseSensitive​(boolean caseSensitive)
      • isValid

        public boolean isValid​(String text)
        Description copied from interface: Parser
        Checks if the supplied text is valid or not.
        Specified by:
        isValid in interface Parser<T>
        Parameters:
        text - The text to be validated.
        Returns:
        true if text is valid, else returns false.
      • getErrorMessage

        public String getErrorMessage()
        Description copied from interface: Parser
        A string with the error message if the parser fails to parse the supplied string.
        Specified by:
        getErrorMessage in interface Parser<T>
        Returns:
        An error message if the parse fails.
      • operators

        public List<String> operators()
        Description copied from interface: Parser
        Returns the list of operators which can be used with this parser.
        Specified by:
        operators in interface Parser<T>
        Returns:
        A list of operators.
      • getSymbol

        public String getSymbol​(String text)
        Description copied from interface: Parser
        Return the symbol related to an operator text which can be used with this parser.
        Specified by:
        getSymbol in interface Parser<T>
        Parameters:
        text - The operator text
        Returns:
        A symbol.