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.ObjectDescribes 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 booleanequals(SyntaxChecker.SyntaxError rhs)Returnstrueif two errors are have identical locations, messages, and error types.booleanequals(java.lang.Object rhs)inthashCode()booleanisWarning()Returnstrueif this error is a warning rather than a true error.intlength()Returns the length of the region implicated in the errorjava.lang.Stringmessage()Returns the text of an error message that describes the error.intoffset()Returns the offset from the document start where the error begins.java.lang.StringtoString()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-trueif 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:
toStringin classjava.lang.Object- Returns:
- an error message string
-
isWarning
public boolean isWarning()
Returnstrueif this error is a warning rather than a true error.- Returns:
truefor 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)
Returnstrueif two errors are have identical locations, messages, and error types.- Parameters:
rhs- the error to compare this error to- Returns:
trueif the errors are equal
-
equals
public boolean equals(java.lang.Object rhs)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-