Package net.sf.saxon.s9api
Class StaticError
java.lang.Object
net.sf.saxon.s9api.StaticError
The StaticError class contains information about a static error detected during compilation
of a stylesheet, query, or XPath expression.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) XPathException(package private) boolean(package private) Location -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintThe coloumn number locating the error within a query or stylesheet moduleThe error code, as a QName.Get a name identifying the kind of instruction, in terms meaningful to a user.intThe line number locating the error within a query or stylesheet moduleReturn the error message associated with this errorThe 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)getPath()Get the absolute XPath expression that identifies the node within its document where the error occurred, if availableReturn the underlying exception.booleanIndicate whether this condition is a type error.booleanIndicate whether this error is being reported as a warning condition.voidsetWarning(boolean warning)
-
Field Details
-
exception
XPathException exception -
locator
Location locator -
isWarning
boolean isWarning
-
-
Constructor Details
-
StaticError
-
StaticError
-
-
Method Details
-
setWarning
public void setWarning(boolean warning) -
getErrorCode
The error code, as a QName. May be null if no error code has been assigned- Returns:
- QName
-
getMessage
Return the error message associated with this error- Returns:
- 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
public int getColumnNumber()The coloumn number locating the error within a query or stylesheet module- Returns:
- int
-
getLineNumber
public 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
public 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
public 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
-
getUnderlyingException
Return the underlying exception. This method may not be stable across Saxon releases.- Returns:
- XPathException the underlying exception
-