Class SyntaxChecker.SyntaxError

  • Enclosing class:
    SyntaxChecker

    public static final class SyntaxChecker.SyntaxError
    extends java.lang.Object
    Describes a syntax error that has been detected during syntax checking. Provides a message, line number, column number, and differentiates between errors and warnings.
    • Constructor Summary

      Constructors 
      Constructor Description
      SyntaxError​(java.lang.String message, boolean warning, int offset, int length)
      Creates a new syntax error with the specified message, source location, and error type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(SyntaxChecker.SyntaxError rhs)
      Returns true if two errors are have identical locations, messages, and error types.
      boolean equals​(java.lang.Object rhs)  
      int hashCode()  
      boolean isWarning()
      Returns true if this error is a warning rather than a true error.
      int length()
      Returns the length of the region implicated in the error
      java.lang.String message()
      Returns the text of an error message that describes the error.
      int offset()
      Returns the offset from the document start where the error begins.
      java.lang.String toString()
      Returns a string representation of the error.
      • Methods inherited from class java.lang.Object

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

      • SyntaxError

        public SyntaxError​(java.lang.String message,
                           boolean warning,
                           int offset,
                           int length)
        Creates a new syntax error with the specified message, source location, and error type.
        Parameters:
        message - the text of the error message
        offset - the offset from the document start at which the error occurs
        length - the number of characters affected by the error
        warning - true if the error is a warning rather than a true error
    • Method Detail

      • toString

        public java.lang.String toString()
        Returns a string representation of the error.
        Overrides:
        toString in class java.lang.Object
        Returns:
        an error message string
      • isWarning

        public boolean isWarning()
        Returns true if this error is a warning rather than a true error.
        Returns:
        true for warning messages
      • offset

        public int offset()
        Returns the offset from the document start where the error begins.
        Returns:
        the error start position
      • length

        public int length()
        Returns the length of the region implicated in the error
        Returns:
        the length of the affected code
      • message

        public java.lang.String message()
        Returns the text of an error message that describes the error.
        Returns:
        the error message
      • equals

        public boolean equals​(SyntaxChecker.SyntaxError rhs)
        Returns true if two errors are have identical locations, messages, and error types.
        Parameters:
        rhs - the error to compare this error to
        Returns:
        true if the errors are equal
      • equals

        public boolean equals​(java.lang.Object rhs)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object