Package net.sf.saxon.s9api

## Interface StaticError

- All Known Subinterfaces:
    `XmlProcessingError`
  All Known Implementing Classes:
    `XmlProcessingException`, `XmlProcessingIncident`

      public interface StaticError

  The StaticError interface is retained in Saxon 10.0 as a marker interface so that the methods `XsltCompiler.setErrorList(List)` and `XQueryCompiler.setErrorList(List)` continue to function.

  The name is misleading, because all errors including dynamic errors implement this interface.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `default int` | `getColumnNumber()` | The coloumn number locating the error within a query or stylesheet module
    `QName` | `getErrorCode()` | The error code, as a QName.
    `java.lang.String` | `getFatalErrorMessage()` | Ask whether this error is to be treated as fatal, and if so, return the relevant messsage
    `default java.lang.String` | `getInstructionName()` | Get a name identifying the kind of instruction, in terms meaningful to a user.
    `default int` | `getLineNumber()` | The line number locating the error within a query or stylesheet module
    `Location` | `getLocation()` | Get the location information associated with the error
    `java.lang.String` | `getMessage()` | Return the error message associated with this error
    `default java.lang.String` | `getModuleUri()` | The URI of the query or stylesheet module in which the error was detected (as a string) May be null if the location of the error is unknown, or if the error is not localized to a specific module, or if the module in question has no known URI (for example, if it was supplied as an anonymous Stream)
    `default java.lang.String` | `getPath()` | Get the absolute XPath expression that identifies the node within its document where the error occurred, if available
    `boolean` | `isTypeError()` | Indicate whether this condition is a type error.
    `boolean` | `isWarning()` | Indicate whether this error is being reported as a warning condition.
    `void` | `setFatal​(java.lang.String message)` | Indicate that this error is to be treated as fatal; that is, execution will be abandoned after reporting this error.

- - ### Method Detail

    - #### getErrorCode

          QName getErrorCode()

      The error code, as a QName. May be null if no error code has been assigned
      Returns:
        QName

    - #### getMessage

          java.lang.String getMessage()

      Return the error message associated with this error
      Returns:
        String

    - #### getLocation

          Location getLocation()

      Get the location information associated with the error
      Returns:
        the location of the error. The result is never null, though it may be a location with little useful information.

    - #### getModuleUri

          default java.lang.String getModuleUri()

      The URI of the query or stylesheet module in which the error was detected (as a string) May be null if the location of the error is unknown, or if the error is not localized to a specific module, or if the module in question has no known URI (for example, if it was supplied as an anonymous Stream)
      Returns:
        String

    - #### getColumnNumber

          default int getColumnNumber()

      The coloumn number locating the error within a query or stylesheet module
      Returns:
        int

    - #### getLineNumber

          default int getLineNumber()

      The line number locating the error within a query or stylesheet module
      Returns:
        int

    - #### getInstructionName

          default java.lang.String getInstructionName()

      Get a name identifying the kind of instruction, in terms meaningful to a user. This method is not used in the case where the instruction name code is a standard name (<1024).
      Returns:
        a name identifying the kind of instruction, in terms meaningful to a user. The name will always be in the form of a lexical XML QName, and should match the name used in explain() output displaying the instruction.

    - #### isWarning

          boolean isWarning()

      Indicate whether this error is being reported as a warning condition. If so, applications may ignore the condition, though the results may not be as intended.
      Returns:
        boolean

    - #### isTypeError

          boolean isTypeError()

      Indicate whether this condition is a type error.
      Returns:
        boolean

    - #### getPath

          default java.lang.String getPath()

      Get the absolute XPath expression that identifies the node within its document where the error occurred, if available
      Returns:
        String - a path expression

    - #### setFatal

          void setFatal​(java.lang.String message)

      Indicate that this error is to be treated as fatal; that is, execution will be abandoned after reporting this error. This method may be called by an `ErrorReporter`, for example if the error is considered so severe that further processing is not worthwhile, or if too many errors have been signalled. There is no absolute guarantee that setting this property will cause execution to be abandoned. If a dynamic error is marked as fatal, it will generally not be caught by any try/catch mechanism within the stylesheet or query.

    - #### getFatalErrorMessage

          java.lang.String getFatalErrorMessage()

      Ask whether this error is to be treated as fatal, and if so, return the relevant messsage
      Returns:
        a non-null message if the error has been marked as a fatal error.