Package org.codehaus.groovy.syntax

# Class SyntaxException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.codehaus.groovy.GroovyException
org.codehaus.groovy.syntax.SyntaxException

All Implemented Interfaces:
  `Serializable`, `GroovyExceptionInterface`

Direct Known Subclasses:
  `IncorrectTypeHintException`, `TokenException`

    public class SyntaxException
    extends GroovyException

Base exception indicating a syntax error.

See Also:
  Serialized Form

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `SyntaxException​(String message, int startLine, int startColumn)` |
  `SyntaxException​(String message, int startLine, int startColumn, int endLine, int endColumn)` |
  `SyntaxException​(String message, Throwable cause, int startLine, int startColumn)` |
  `SyntaxException​(String message, Throwable cause, int startLine, int startColumn, int endLine, int endColumn)` |
  `SyntaxException​(String message, ASTNode node)` |

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `int` | `getEndColumn()` |
  `int` | `getEndLine()` |
  `int` | `getLine()` | Retrieve the line upon which the error occurred.
  `String` | `getMessage()` |
  `String` | `getOriginalMessage()` |
  `String` | `getSourceLocator()` |
  `int` | `getStartColumn()` | Retrieve the column upon which the error occurred.
  `int` | `getStartLine()` |
  `void` | `setSourceLocator​(String sourceLocator)` |

  ### Methods inherited from class org.codehaus.groovy.GroovyException

  `isFatal, setFatal`

  ### Methods inherited from class java.lang.Throwable

  `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### SyntaxException

    public SyntaxException​(String message, ASTNode node)

  - ### SyntaxException

    public SyntaxException​(String message, int startLine, int startColumn)

  - ### SyntaxException

    public SyntaxException​(String message, int startLine, int startColumn, int endLine, int endColumn)

  - ### SyntaxException

    public SyntaxException​(String message, Throwable cause, int startLine, int startColumn)

  - ### SyntaxException

    public SyntaxException​(String message, Throwable cause, int startLine, int startColumn, int endLine, int endColumn)

- ## Method Details

  - ### setSourceLocator

    public void setSourceLocator​(String sourceLocator)

  - ### getSourceLocator

    public String getSourceLocator()

  - ### getLine

    public int getLine()
    Retrieve the line upon which the error occurred.
    Returns:
      The line.

  - ### getStartLine

    public int getStartLine()
    Returns:
      the line on which the error occurs

  - ### getStartColumn

    public int getStartColumn()
    Retrieve the column upon which the error occurred.
    Returns:
      The column.

  - ### getEndLine

    public int getEndLine()
    Returns:
      the end line on which the error occurs

  - ### getEndColumn

    public int getEndColumn()
    Returns:
      the end column on which the error occurs

  - ### getOriginalMessage

    public String getOriginalMessage()

  - ### getMessage

    public String getMessage()
    Overrides:
      `getMessage` in class `Throwable`