Class DefaultInvalidInputErrorFormatter

java.lang.Object
org.parboiled.errors.DefaultInvalidInputErrorFormatter
All Implemented Interfaces:
Formatter<InvalidInputError>

public class DefaultInvalidInputErrorFormatter extends Object implements Formatter<InvalidInputError>
A Formatter for InvalidInputErrors that automatically creates the correct "expected" text for the error.
  • Constructor Details

    • DefaultInvalidInputErrorFormatter

      public DefaultInvalidInputErrorFormatter()
  • Method Details

    • format

      public String format(InvalidInputError error)
      Description copied from interface: Formatter
      Create a string representation for the given obejct.
      Specified by:
      format in interface Formatter<InvalidInputError>
      Parameters:
      error - the object to format
      Returns:
      a string describing the object
    • getExpectedString

      public String getExpectedString(InvalidInputError error)
    • getLabels

      public String[] getLabels(Matcher matcher)
      Gets the labels corresponding to the given matcher, AnyOfMatchers are treated specially in that their label is constructed as a list of their contents
      Parameters:
      matcher - the matcher
      Returns:
      the labels
    • join

      public String join(List<String> labelList)