Package net.sf.saxon.s9api
Class StaticError
- java.lang.Object
-
- net.sf.saxon.s9api.StaticError
-
public class StaticError extends Object
The StaticError class contains information about a static error detected during compilation of a stylesheet, query, or XPath expression.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) XPathExceptionexception(package private) booleanisWarning(package private) Locationlocator
-
Constructor Summary
Constructors Constructor Description StaticError(TransformerException err)StaticError(TransformerException err, boolean isWarning)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetColumnNumber()The coloumn number locating the error within a query or stylesheet moduleQNamegetErrorCode()The error code, as a QName.StringgetInstructionName()Get a name identifying the kind of instruction, in terms meaningful to a user.intgetLineNumber()The line number locating the error within a query or stylesheet moduleStringgetMessage()Return the error message associated with this errorStringgetModuleUri()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)StringgetPath()Get the absolute XPath expression that identifies the node within its document where the error occurred, if availableXPathExceptiongetUnderlyingException()Return the underlying exception.booleanisTypeError()Indicate whether this condition is a type error.booleanisWarning()Indicate whether this error is being reported as a warning condition.voidsetWarning(boolean warning)
-
-
-
Field Detail
-
exception
XPathException exception
-
locator
Location locator
-
isWarning
boolean isWarning
-
-
Constructor Detail
-
StaticError
public StaticError(TransformerException err, boolean isWarning)
-
StaticError
public StaticError(TransformerException err)
-
-
Method Detail
-
setWarning
public void setWarning(boolean warning)
-
getErrorCode
public QName getErrorCode()
The error code, as a QName. May be null if no error code has been assigned- Returns:
- QName
-
getMessage
public String getMessage()
Return the error message associated with this error- Returns:
- String
-
getModuleUri
public 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
public 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
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
public 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
-
getUnderlyingException
public XPathException getUnderlyingException()
Return the underlying exception. This method may not be stable across Saxon releases.- Returns:
- XPathException the underlying exception
-
-