Package net.sf.saxon.s9api
Interface StaticError
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
Modifier and TypeMethodDescriptiondefault int
The coloumn number locating the error within a query or stylesheet moduleThe error code, as a QName.default String
Get a name identifying the kind of instruction, in terms meaningful to a user.default int
The line number locating the error within a query or stylesheet moduleGet the location information associated with the errorReturn the error message associated with this errordefault String
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 String
getPath()
Get the absolute XPath expression that identifies the node within its document where the error occurred, if availableAsk whether this error is to be treated as fatal, and if so, return the relevant messageboolean
Indicate whether this condition is a type error.boolean
Indicate whether this error is being reported as a warning condition.void
setTerminationMessage
(String message) Indicate that this error is to be treated as fatal; that is, execution will be abandoned after reporting this error.
-
Method Details
-
getErrorCode
QName getErrorCode()The error code, as a QName. May be null if no error code has been assigned- Returns:
- QName
-
getMessage
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
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
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
Get the absolute XPath expression that identifies the node within its document where the error occurred, if available- Returns:
- String - a path expression
-
setTerminationMessage
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 anErrorReporter
, 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.- Parameters:
message
- the message
-
getTerminationMessage
String getTerminationMessage()Ask whether this error is to be treated as fatal, and if so, return the relevant message- Returns:
- a non-null message if the error has been marked as a fatal error.
-