Package net.sf.saxon.s9api
Interface XmlProcessingError
-
- All Superinterfaces:
StaticError
- All Known Implementing Classes:
XmlProcessingException
,XmlProcessingIncident
public interface XmlProcessingError extends StaticError
The XmlProcessingError class contains information about an error detected during compilation or execution of a stylesheet, query, XPath expression, or schemaThe interface extends
StaticError
so that the methodsXsltCompiler.setErrorList(List)
andXQueryCompiler.setErrorList(List)
continue to function. It is not the case, however, that everyXmlProcessingError
is a static error.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description XmlProcessingError
asWarning()
Return an XmlProcessingError containing the same information, but to be treated as a warning conditionjava.lang.Throwable
getCause()
Return an underlying exception.QName
getErrorCode()
Get the error code, as a QName.HostLanguage
getHostLanguage()
Location
getLocation()
Get the location information associated with the errorjava.lang.String
getMessage()
Get the error message associated with this errordefault java.lang.String
getModuleUri()
Get 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)java.lang.String
getPath()
Get the absolute XPath expression that identifies the node within its document where the error occurred, if availableboolean
isAlreadyReported()
Ask whether this static error has already been reportedboolean
isStaticError()
Ask whether this is a static error, defined as an error that can be detected during static analysis of a stylesheet, query, schema, or XPath expression.boolean
isTypeError()
Ask whether this is a type error.boolean
isWarning()
Ask whether this error is being reported as a warning condition.void
setAlreadyReported(boolean reported)
Say whether this error has already been reported-
Methods inherited from interface net.sf.saxon.s9api.StaticError
getColumnNumber, getFatalErrorMessage, getInstructionName, getLineNumber, setFatal
-
-
-
-
Method Detail
-
getHostLanguage
HostLanguage getHostLanguage()
-
isStaticError
boolean isStaticError()
Ask whether this is a static error, defined as an error that can be detected during static analysis of a stylesheet, query, schema, or XPath expression.- Returns:
- true if this is a static error
-
isTypeError
boolean isTypeError()
Ask whether this is a type error. Saxon reports type errors statically if it can establish that a supplied value will never satisfy the required type- Specified by:
isTypeError
in interfaceStaticError
- Returns:
- true if this is a type error
-
getErrorCode
QName getErrorCode()
Get the error code, as a QName. This may be null if no error code has been assigned- Specified by:
getErrorCode
in interfaceStaticError
- Returns:
- QName
-
getMessage
java.lang.String getMessage()
Get the error message associated with this error- Specified by:
getMessage
in interfaceStaticError
- Returns:
- String the error message
-
getLocation
Location getLocation()
Get the location information associated with the error- Specified by:
getLocation
in interfaceStaticError
- 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()
Get 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)- Specified by:
getModuleUri
in interfaceStaticError
- Returns:
- the URI identifying the location of the stylesheet module or query module
-
isWarning
boolean isWarning()
Ask 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.- Specified by:
isWarning
in interfaceStaticError
- Returns:
- true if a condition is detected that is not an error according to the language specification, but which may indicate that the query or stylesheet might behave in unexpected ways
-
getPath
java.lang.String getPath()
Get the absolute XPath expression that identifies the node within its document where the error occurred, if available- Specified by:
getPath
in interfaceStaticError
- Returns:
- a path expression identifying the location of the error within an XML document, or null if the information is not available
-
getCause
java.lang.Throwable getCause()
Return an underlying exception. For example, if the static error was caused by failure to retrieve another stylesheet or query module, this may contain the IO exception that was reported; or if the XML parser was unable to parse a stylesheet module, it may contain a SAXException reported by the parser.- Returns:
- the underlying exception if there was one, or null otherwise
-
asWarning
XmlProcessingError asWarning()
Return an XmlProcessingError containing the same information, but to be treated as a warning condition
-
isAlreadyReported
boolean isAlreadyReported()
Ask whether this static error has already been reported- Returns:
- true if the error has already been reported
-
setAlreadyReported
void setAlreadyReported(boolean reported)
Say whether this error has already been reported- Parameters:
reported
- true if the error has been reported
-
-