Record Class VisualErrorData
java.lang.Object
java.lang.Record
org.ek9lang.compiler.common.VisualErrorData
- Record Components:
classification- The error classification (Error, Warning, etc.)errorCode- The error code (e.g., "E02010")fileName- The source file namelineNumber- The 1-based line numberposition- The 0-based character position on the linetokenLength- The length of the offending tokensourceLine- The actual source code line contenterrorMessage- The primary error messagedetailMessage- Additional detail message (can be null)fuzzyResults- Fuzzy match suggestions (can be null)forAIPath- The forAI.json path for AI guidance (can be null)
public record VisualErrorData(String classification, String errorCode, String fileName, int lineNumber, int position, int tokenLength, String sourceLine, String errorMessage, String detailMessage, MatchResults fuzzyResults, String forAIPath)
extends Record
Groups all the data needed to format a visual error display.
Replaces the 11-parameter format method signature in VisualErrorFormatter.
-
Constructor Summary
ConstructorsConstructorDescriptionVisualErrorData(String classification, String errorCode, String fileName, int lineNumber, int position, int tokenLength, String sourceLine, String errorMessage, String detailMessage, MatchResults fuzzyResults, String forAIPath) Creates an instance of aVisualErrorDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theclassificationrecord component.Returns the value of thedetailMessagerecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theerrorCoderecord component.Returns the value of theerrorMessagerecord component.fileName()Returns the value of thefileNamerecord component.Returns the value of theforAIPathrecord component.Returns the value of thefuzzyResultsrecord component.(package private) boolean(package private) boolean(package private) booleanfinal inthashCode()Returns a hash code value for this object.(package private) boolean(package private) booleanisError()intReturns the value of thelineNumberrecord component.intposition()Returns the value of thepositionrecord component.Returns the value of thesourceLinerecord component.intReturns the value of thetokenLengthrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
VisualErrorData
public VisualErrorData(String classification, String errorCode, String fileName, int lineNumber, int position, int tokenLength, String sourceLine, String errorMessage, String detailMessage, MatchResults fuzzyResults, String forAIPath) Creates an instance of aVisualErrorDatarecord class.- Parameters:
classification- the value for theclassificationrecord componenterrorCode- the value for theerrorCoderecord componentfileName- the value for thefileNamerecord componentlineNumber- the value for thelineNumberrecord componentposition- the value for thepositionrecord componenttokenLength- the value for thetokenLengthrecord componentsourceLine- the value for thesourceLinerecord componenterrorMessage- the value for theerrorMessagerecord componentdetailMessage- the value for thedetailMessagerecord componentfuzzyResults- the value for thefuzzyResultsrecord componentforAIPath- the value for theforAIPathrecord component
-
-
Method Details
-
isError
boolean isError() -
hasErrorCode
boolean hasErrorCode() -
hasFuzzyResults
boolean hasFuzzyResults() -
hasAIPath
boolean hasAIPath() -
hasSourceLine
boolean hasSourceLine() -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
classification
Returns the value of theclassificationrecord component.- Returns:
- the value of the
classificationrecord component
-
errorCode
-
fileName
-
lineNumber
public int lineNumber()Returns the value of thelineNumberrecord component.- Returns:
- the value of the
lineNumberrecord component
-
position
-
tokenLength
public int tokenLength()Returns the value of thetokenLengthrecord component.- Returns:
- the value of the
tokenLengthrecord component
-
sourceLine
Returns the value of thesourceLinerecord component.- Returns:
- the value of the
sourceLinerecord component
-
errorMessage
Returns the value of theerrorMessagerecord component.- Returns:
- the value of the
errorMessagerecord component
-
detailMessage
Returns the value of thedetailMessagerecord component.- Returns:
- the value of the
detailMessagerecord component
-
fuzzyResults
Returns the value of thefuzzyResultsrecord component.- Returns:
- the value of the
fuzzyResultsrecord component
-
forAIPath
-