Class SyntaxChecker.SyntaxError
- java.lang.Object
-
- ca.cgjennings.apps.arkham.plugins.engine.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)
Returnstrue
if two errors are have identical locations, messages, and error types.boolean
equals(java.lang.Object rhs)
int
hashCode()
boolean
isWarning()
Returnstrue
if this error is a warning rather than a true error.int
length()
Returns the length of the region implicated in the errorjava.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.
-
-
-
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 messageoffset
- the offset from the document start at which the error occurslength
- the number of characters affected by the errorwarning
-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 classjava.lang.Object
- Returns:
- an error message string
-
isWarning
public boolean isWarning()
Returnstrue
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)
Returnstrue
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 classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-