public class XmlProcessingIncident extends java.lang.Object implements XmlProcessingError
XmlProcessingError
interface that holds all the required information internally. (That is, no exception objects
are involved.)Constructor and Description |
---|
XmlProcessingIncident(java.lang.String message)
Create an Incident
|
XmlProcessingIncident(java.lang.String message,
java.lang.String errorCode)
Create an Incident
|
XmlProcessingIncident(java.lang.String message,
java.lang.String errorCode,
Location location)
Create an XmlProcessingIncident
|
XmlProcessingIncident(javax.xml.transform.TransformerException err,
boolean isWarning) |
Modifier and Type | Method and Description |
---|---|
XmlProcessingIncident |
asWarning()
Return an XmlProcessingError containing the same information, but to be treated as
a warning condition
|
java.lang.Throwable |
getCause()
Return the underlying exception.
|
int |
getColumnNumber()
The coloumn number locating the error within a query or stylesheet module
|
QName |
getErrorCode()
The error code, as a QName.
|
java.lang.String |
getFatalErrorMessage()
Ask whether this error is to be treated as fatal, and return the associated message
|
HostLanguage |
getHostLanguage() |
java.lang.String |
getInstructionName()
Get a name identifying the kind of instruction, in terms meaningful to a user.
|
int |
getLineNumber()
The line number locating the error within a query or stylesheet module
|
Location |
getLocation()
Get the location information associated with the error
|
java.lang.String |
getMessage()
Return the error message associated with this error
|
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)
|
java.lang.String |
getPath()
Get the absolute XPath expression that identifies the node within its document
where the error occurred, if available
|
boolean |
isAlreadyReported()
Ask whether this static error has already been reported
|
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.
|
boolean |
isTypeError()
Ask whether this is a type error.
|
boolean |
isWarning()
Ask whether this error is being reported as a warning condition.
|
static void |
maybeSetHostLanguage(XmlProcessingError error,
HostLanguage lang) |
static void |
maybeSetLocation(XmlProcessingError error,
Location loc) |
void |
setAlreadyReported(boolean reported)
Say whether this error has already been reported
|
void |
setCause(java.lang.Throwable cause) |
void |
setErrorCodeAsEQName(java.lang.String code) |
void |
setFatal(java.lang.String message)
Indicate that this error is to be treated as fatal; that is, execution will be abandoned
after reporting this error.
|
void |
setHostLanguage(HostLanguage language) |
void |
setLocation(Location loc) |
void |
setStaticError(boolean isStaticError) |
void |
setTypeError(boolean isTypeError) |
void |
setWarning(boolean warning) |
public XmlProcessingIncident(java.lang.String message, java.lang.String errorCode, Location location)
message
- the error messageerrorCode
- the error code, supplied either as a local name, or in Q{uri}local
format. If supplied as a local name, the standard error namespace is assumed.location
- the location of the errorpublic XmlProcessingIncident(java.lang.String message)
message
- the error messagepublic XmlProcessingIncident(java.lang.String message, java.lang.String errorCode)
message
- the error messageerrorCode
- the error code, supplied either as a local name, or in Q{uri}local
format. If supplied as a local name, the standard error namespace is assumed.public XmlProcessingIncident(javax.xml.transform.TransformerException err, boolean isWarning)
public void setWarning(boolean warning)
public XmlProcessingIncident asWarning()
XmlProcessingError
asWarning
in interface XmlProcessingError
public void setFatal(java.lang.String message)
ErrorReporter
, 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.setFatal
in interface StaticError
public java.lang.String getFatalErrorMessage()
getFatalErrorMessage
in interface StaticError
public boolean isAlreadyReported()
isAlreadyReported
in interface XmlProcessingError
public void setAlreadyReported(boolean reported)
setAlreadyReported
in interface XmlProcessingError
reported
- true if the error has been reportedpublic HostLanguage getHostLanguage()
getHostLanguage
in interface XmlProcessingError
public void setHostLanguage(HostLanguage language)
public boolean isTypeError()
XmlProcessingError
isTypeError
in interface StaticError
isTypeError
in interface XmlProcessingError
public void setTypeError(boolean isTypeError)
public boolean isStaticError()
XmlProcessingError
isStaticError
in interface XmlProcessingError
public void setStaticError(boolean isStaticError)
public QName getErrorCode()
getErrorCode
in interface StaticError
getErrorCode
in interface XmlProcessingError
public void setErrorCodeAsEQName(java.lang.String code)
public java.lang.String getMessage()
getMessage
in interface StaticError
getMessage
in interface XmlProcessingError
public java.lang.String getModuleUri()
getModuleUri
in interface StaticError
getModuleUri
in interface XmlProcessingError
public Location getLocation()
XmlProcessingError
getLocation
in interface StaticError
getLocation
in interface XmlProcessingError
public void setLocation(Location loc)
public int getColumnNumber()
getColumnNumber
in interface StaticError
public int getLineNumber()
getLineNumber
in interface StaticError
public java.lang.String getInstructionName()
getInstructionName
in interface StaticError
public boolean isWarning()
isWarning
in interface StaticError
isWarning
in interface XmlProcessingError
public java.lang.String getPath()
getPath
in interface StaticError
getPath
in interface XmlProcessingError
public java.lang.Throwable getCause()
getCause
in interface XmlProcessingError
public void setCause(java.lang.Throwable cause)
public static void maybeSetHostLanguage(XmlProcessingError error, HostLanguage lang)
public static void maybeSetLocation(XmlProcessingError error, Location loc)
Copyright (c) 2004-2022 Saxonica Limited. All rights reserved.