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>
A Formatter
for InvalidInputError
s that automatically creates the correct "expected" text
for the error.
Method Summary |
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 contents |
java.lang.String |
join(java.util.List<java.lang.String> labelList)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultInvalidInputErrorFormatter
public DefaultInvalidInputErrorFormatter()
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 interface Formatter<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)