Class PrologParserException

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    CharBufferOverflowException

    public class PrologParserException
    extends java.lang.RuntimeException
    Exception is thrown if any problem with parsing of prolog sources.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int line  
      protected int pos  
      private static long serialVersionUID  
    • Constructor Summary

      Constructors 
      Constructor Description
      PrologParserException​(java.lang.String text, int line, int pos)
      Constructor
      PrologParserException​(java.lang.String text, int line, int pos, java.lang.Throwable cause)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getLine()
      Get the error line, first line has index 1
      int getPos()
      Get the error line position, first position has index 1
      boolean hasValidPosition()
      Check that the exception contains valid position
      java.lang.String toString()  
      • Methods inherited from class java.lang.Throwable

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

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

      • line

        protected final int line
      • pos

        protected final int pos
    • Constructor Detail

      • PrologParserException

        public PrologParserException​(java.lang.String text,
                                     int line,
                                     int pos)
        Constructor
        Parameters:
        text - text of parsing error
        line - line where the error has been detected
        pos - line position where the error has been detected
      • PrologParserException

        public PrologParserException​(java.lang.String text,
                                     int line,
                                     int pos,
                                     java.lang.Throwable cause)
        Constructor
        Parameters:
        text - text of parsing error
        line - line where the error has been detected
        pos - line position where the error has been detected
        cause - the root exception
    • Method Detail

      • getLine

        public int getLine()
        Get the error line, first line has index 1
        Returns:
        the error line, -1 if the line is undefined
      • getPos

        public int getPos()
        Get the error line position, first position has index 1
        Returns:
        the error line position, -1 if the position is undefined
      • hasValidPosition

        public boolean hasValidPosition()
        Check that the exception contains valid position
        Returns:
        true if position and line have been defined in the exception
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Throwable