Class KStringParseException

  • All Implemented Interfaces:
    java.io.Serializable

    public class KStringParseException
    extends KStringException
    Exception class used for KString parsing errors.
    Author:
    Christopher Mindus
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      ConstructorDescription
      KStringParseException​(java.lang.String message, java.lang.String inputString, int parsePosition)
      Constructs a KString parse exception.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      java.lang.StringgetFixedCharacterOutput()
      Formats a string that can be used by e.g.
      java.lang.StringgetInputString()
      Gets the input string that caused the error.
      intgetParsePosition()
      Gets the parsing position where the error occurred.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • KStringParseException

        public KStringParseException​(java.lang.String message,
                                     java.lang.String inputString,
                                     int parsePosition)
        Constructs a KString parse exception.
        Parameters:
        message - The message string.
        inputString - The HTML input string.
        parsePosition - The error position in the input string.
    • Method Detail

      • getParsePosition

        public int getParsePosition()
        Gets the parsing position where the error occurred.
        Returns:
        The position in the input string that caused the error.
      • getInputString

        public java.lang.String getInputString()
        Gets the input string that caused the error.
        Returns:
        The input string for the error.
      • getFixedCharacterOutput

        public java.lang.String getFixedCharacterOutput()
        Formats a string that can be used by e.g. System.out to display the parse error. The output consists of two lines separated with the system line separator where the first line is the input string, the second line the indication to where the error is located.
        Returns:
        A fixed format string consisting of two lines.