Class ScriptError

java.lang.Object
org.openhab.core.model.script.engine.ScriptError

public final class ScriptError extends Object
A detailed error information for a script
Author:
Kai Kreuzer - Initial contribution
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    ScriptError(String message, int line, int column, int length)
    Creates new ScriptError.
    ScriptError(String message, org.eclipse.emf.ecore.EObject atEObject)
    Creates new ScriptError.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Get the column number on which an error occurred.
    int
    Get the number of columns affected by the error.
    int
    Get the line number on which an error occurred.
    Returns a message containing the String passed to a constructor as well as line and column numbers if any of these are known.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ScriptError

      public ScriptError(String message, int line, int column, int length)
      Creates new ScriptError.
      Parameters:
      message - Error Message
      line - Line number, or -1 if unknown
      column - Column number, or -1 if unknown
      length - Length, or -1 if unknown
    • ScriptError

      public ScriptError(String message, org.eclipse.emf.ecore.EObject atEObject)
      Creates new ScriptError. This constructor uses the given EObject instance to calculate the exact position.
      Parameters:
      message - Error Message
      atEObject - the EObject instance to use for calculating the position
  • Method Details

    • getMessage

      public String getMessage()
      Returns a message containing the String passed to a constructor as well as line and column numbers if any of these are known.
      Returns:
      The error message.
    • getLineNumber

      public int getLineNumber()
      Get the line number on which an error occurred.
      Returns:
      The line number. Returns -1 if a line number is unavailable.
    • getColumnNumber

      public int getColumnNumber()
      Get the column number on which an error occurred.
      Returns:
      The column number. Returns -1 if a column number is unavailable.
    • getLength

      public int getLength()
      Get the number of columns affected by the error.
      Returns:
      The number of columns. Returns -1 if unavailable.