Class ParseException

  • All Implemented Interfaces:
    java.io.Serializable

    public class ParseException
    extends java.lang.RuntimeException
    An unchecked exception to indicate that an input does not qualify as valid JSON.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Location location  
    • Constructor Summary

      Constructors 
      Constructor Description
      ParseException​(java.lang.String message, Location location)  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      int getColumn()
      Deprecated.
      Use getLocation() instead
      int getLine()
      Deprecated.
      Use getLocation() instead
      Location getLocation()
      Returns the location at which the error occurred.
      int getOffset()
      Deprecated.
      Use getLocation() instead
      • 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
    • Field Detail

      • location

        private final Location location
    • Constructor Detail

      • ParseException

        ParseException​(java.lang.String message,
                       Location location)
    • Method Detail

      • getLocation

        public Location getLocation()
        Returns the location at which the error occurred.
        Returns:
        the error location
      • getOffset

        @Deprecated
        public int getOffset()
        Deprecated.
        Use getLocation() instead
        Returns the absolute character index at which the error occurred. The offset of the first character of a document is 0.
        Returns:
        the character offset at which the error occurred, will be >= 0
      • getLine

        @Deprecated
        public int getLine()
        Deprecated.
        Use getLocation() instead
        Returns the line number in which the error occurred. The number of the first line is 1.
        Returns:
        the line in which the error occurred, will be >= 1
      • getColumn

        @Deprecated
        public int getColumn()
        Deprecated.
        Use getLocation() instead
        Returns the column number at which the error occurred, i.e. the number of the character in its line. The number of the first character of a line is 1.
        Returns:
        the column in which the error occurred, will be >= 1