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 name
lineNumber - The 1-based line number
position - The 0-based character position on the line
tokenLength - The length of the offending token
sourceLine - The actual source code line content
errorMessage - The primary error message
detailMessage - 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 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 a VisualErrorData record class.
      Parameters:
      classification - the value for the classification record component
      errorCode - the value for the errorCode record component
      fileName - the value for the fileName record component
      lineNumber - the value for the lineNumber record component
      position - the value for the position record component
      tokenLength - the value for the tokenLength record component
      sourceLine - the value for the sourceLine record component
      errorMessage - the value for the errorMessage record component
      detailMessage - the value for the detailMessage record component
      fuzzyResults - the value for the fuzzyResults record component
      forAIPath - the value for the forAIPath record component
  • Method Details

    • isError

      boolean isError()
    • hasErrorCode

      boolean hasErrorCode()
    • hasFuzzyResults

      boolean hasFuzzyResults()
    • hasAIPath

      boolean hasAIPath()
    • hasSourceLine

      boolean hasSourceLine()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • classification

      public String classification()
      Returns the value of the classification record component.
      Returns:
      the value of the classification record component
    • errorCode

      public String errorCode()
      Returns the value of the errorCode record component.
      Returns:
      the value of the errorCode record component
    • fileName

      public String fileName()
      Returns the value of the fileName record component.
      Returns:
      the value of the fileName record component
    • lineNumber

      public int lineNumber()
      Returns the value of the lineNumber record component.
      Returns:
      the value of the lineNumber record component
    • position

      public int position()
      Returns the value of the position record component.
      Returns:
      the value of the position record component
    • tokenLength

      public int tokenLength()
      Returns the value of the tokenLength record component.
      Returns:
      the value of the tokenLength record component
    • sourceLine

      public String sourceLine()
      Returns the value of the sourceLine record component.
      Returns:
      the value of the sourceLine record component
    • errorMessage

      public String errorMessage()
      Returns the value of the errorMessage record component.
      Returns:
      the value of the errorMessage record component
    • detailMessage

      public String detailMessage()
      Returns the value of the detailMessage record component.
      Returns:
      the value of the detailMessage record component
    • fuzzyResults

      public MatchResults fuzzyResults()
      Returns the value of the fuzzyResults record component.
      Returns:
      the value of the fuzzyResults record component
    • forAIPath

      public String forAIPath()
      Returns the value of the forAIPath record component.
      Returns:
      the value of the forAIPath record component