Class ParseException

    • Method Detail

      • withBounds

        public static ParseException withBounds​(String errorMessage,
                                                String logMessage,
                                                int start,
                                                int end)
        Creates a new parse exception for situations in which both the start and end positions of the error are known.
        Parameters:
        errorMessage - the user error message.
        logMessage - the original log message.
        start - the index of the first character in the invalid section of the log message.
        end - the index after the last character in the invalid section of the log message.
        Returns:
        the parser exception.
      • atPosition

        public static ParseException atPosition​(String errorMessage,
                                                String logMessage,
                                                int position)
        Creates a new parse exception for situations in which the position of the error is known.
        Parameters:
        errorMessage - the user error message.
        logMessage - the original log message.
        position - the index of the invalid character in the log message.
        Returns:
        the parser exception.
      • withStartPosition

        public static ParseException withStartPosition​(String errorMessage,
                                                       String logMessage,
                                                       int start)
        Creates a new parse exception for situations in which only the start position of the error is known.
        Parameters:
        errorMessage - the user error message.
        logMessage - the original log message.
        start - the index of the first character in the invalid section of the log message.
        Returns:
        the parser exception.
      • generic

        public static ParseException generic​(String errorMessage,
                                             String logMessage)
        Creates a new parse exception for cases where position is not relevant.
        Parameters:
        errorMessage - the user error message.
        logMessage - the original log message.