public interface IStatus
CoreExceptions carry a status object to indicate
what went wrong. Status objects are also returned by methods needing
to provide details of failures (e.g., validation methods).
A status carries the following information:
Some status objects, known as multi-statuses, have other status objects as children.
The class Status is the standard public implementation
of status objects; the subclass MultiStatus is the
implements multi-status objects.
This interface can be used without OSGi running.
MultiStatus,
Status| Modifier and Type | Field and Description |
|---|---|
static int |
CANCEL
Status type severity (bit mask, value 8) indicating this status represents a
cancelation
|
static int |
ERROR
Status type severity (bit mask, value 4) indicating this status represents an error.
|
static int |
INFO
Status type severity (bit mask, value 1) indicating this status is informational only.
|
static int |
OK
Status severity constant (value 0) indicating this status represents the nominal case.
|
static int |
WARNING
Status type severity (bit mask, value 2) indicating this status represents a warning.
|
| Modifier and Type | Method and Description |
|---|---|
IStatus[] |
getChildren()
Returns a list of status object immediately contained in this
multi-status, or an empty list if this is not a multi-status.
|
int |
getCode()
Returns the plug-in-specific status code describing the outcome.
|
java.lang.Throwable |
getException()
Returns the relevant low-level exception, or
null if none. |
java.lang.String |
getMessage()
Returns the message describing the outcome.
|
java.lang.String |
getPlugin()
Returns the unique identifier of the plug-in associated with this status
(this is the plug-in that defines the meaning of the status code).
|
int |
getSeverity()
Returns the severity.
|
boolean |
isMultiStatus()
Returns whether this status is a multi-status.
|
boolean |
isOK()
Returns whether this status indicates everything is okay
(neither info, warning, nor error).
|
boolean |
matches(int severityMask)
Returns whether the severity of this status matches the given
severity mask.
|
static final int OK
getSeverity(),
isOK(),
Status.OK_STATUS,
Constant Field Valuesstatic final int INFO
static final int WARNING
static final int ERROR
static final int CANCEL
getSeverity(),
matches(int),
Status.CANCEL_STATUS,
Constant Field ValuesIStatus[] getChildren()
isMultiStatus()int getCode()
java.lang.Throwable getException()
null if none.
For example, when an operation fails because of a network communications
failure, this might return the java.io.IOException
describing the exact nature of that failure.null if nonejava.lang.String getMessage()
java.lang.String getPlugin()
int getSeverity()
CANCEL - cancelation occurredERROR - a serious error (most severe)WARNING - a warning (less severe)INFO - an informational ("fyi") message (least severe)OK - everything is just fine
The severity of a multi-status is defined to be the maximum
severity of any of its children, or OK if it has
no children.
OK, ERROR,
INFO, WARNING, or CANCELmatches(int)boolean isMultiStatus()
The severity of a multi-status is derived from the severities
of its children; a multi-status with no children is
OK by definition.
A multi-status carries a plug-in identifier, a status code,
a message, and an optional exception. Clients may treat
multi-status objects in a multi-status unaware way.
true for a multi-status,
false otherwisegetChildren()boolean isOK()
true if this status has severity
OK, and false otherwiseboolean matches(int severityMask)
OK
will never match; use isOK instead to detect
a status with a severity of OK.severityMask - a mask formed by bitwise or'ing severity mask
constants (ERROR, WARNING,
INFO, CANCEL)true if there is at least one match,
false if there are no matchesgetSeverity(),
CANCEL,
ERROR,
WARNING,
INFO