Package org.parboiled.errors
Class DefaultInvalidInputErrorFormatter
- java.lang.Object
-
- org.parboiled.errors.DefaultInvalidInputErrorFormatter
-
- All Implemented Interfaces:
Formatter<InvalidInputError>
public class DefaultInvalidInputErrorFormatter extends java.lang.Object implements Formatter<InvalidInputError>
AFormatter
forInvalidInputError
s that automatically creates the correct "expected" text for the error.
-
-
Constructor Summary
Constructors Constructor Description DefaultInvalidInputErrorFormatter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
format(InvalidInputError error)
Create a string representation for the given obejct.java.lang.String
getExpectedString(InvalidInputError error)
java.lang.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 contentsjava.lang.String
join(java.util.List<java.lang.String> labelList)
-
-
-
Method Detail
-
format
public java.lang.String format(InvalidInputError error)
Description copied from interface:Formatter
Create a string representation for the given obejct.- Specified by:
format
in interfaceFormatter<InvalidInputError>
- Parameters:
error
- the object to format- Returns:
- a string describing the object
-
getExpectedString
public java.lang.String getExpectedString(InvalidInputError error)
-
getLabels
public java.lang.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 java.lang.String join(java.util.List<java.lang.String> labelList)
-
-