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 methodsXsltCompiler.setErrorList(List)
andXQueryCompiler.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 moduleQName
getErrorCode()
The error code, as a QName.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 moduleLocation
getLocation()
Get the location information associated with the errorjava.lang.String
getMessage()
Return the error message associated with this errordefault 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 availablejava.lang.String
getTerminationMessage()
Ask whether this error is to be treated as fatal, and if so, return the relevant messageboolean
isTypeError()
Indicate whether this condition is a type error.boolean
isWarning()
Indicate whether this error is being reported as a warning condition.void
setTerminationMessage(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
-
setTerminationMessage
void setTerminationMessage(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 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
java.lang.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.
-
-