public static String printParseError ( ParseError error , Formatter < InvalidInputError > formatter ) { checkArgNotNull ( error , "error" ) ; checkArgNotNull ( formatter , "formatter" ) ; String message = error . getErrorMessage ( ) != null ? error . getErrorMessage ( ) : error instanceof InvalidInputError ? formatter . format ( ( InvalidInputError ) error ) : error . getClass ( ) . getSimpleName ( ) ; return printErrorMessage ( "%s (line %s, pos %s):" , message , error . getStartIndex ( ) , error . getEndIndex ( ) , error . getInputBuffer ( ) ) ; }
Pretty prints the given parse error showing its location in the given input buffer .