|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.core.runtime.Status
A concrete status implementation, suitable either for instantiating or subclassing.
Field Summary |
Fields inherited from interface org.eclipse.core.runtime.IStatus |
ERROR, INFO, OK, WARNING |
Constructor Summary | |
Status(int severity,
String pluginId,
int code,
String message,
Throwable exception)
Creates a new status object. |
Method Summary | |
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. |
Throwable |
getException()
Returns the relevant low-level exception, or null if none. |
String |
getMessage()
Returns the message describing the outcome. |
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 specification. |
protected void |
setCode(int code)
Sets the status code. |
protected void |
setException(Throwable exception)
Sets the exception. |
protected void |
setMessage(String message)
Sets the message. |
protected void |
setPlugin(String pluginId)
Sets the plug-in id. |
protected void |
setSeverity(int severity)
Sets the severity. |
String |
toString()
Returns a string representation of the status, suitable for debugging purposes only. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Status(int severity, String pluginId, int code, String message, Throwable exception)
severity
- the severity; one of OK
,
ERROR
, INFO
, or WARNING
pluginId
- the unique identifier of the relevant plug-incode
- the plug-in-specific status code, or OK
message
- a human-readable message, localized to the
current localeexception
- a low-level exception, or null
if not
applicableMethod Detail |
public IStatus[] getChildren()
IStatus
getChildren
in interface IStatus
IStatus.isMultiStatus()
public int getCode()
IStatus
getCode
in interface IStatus
public Throwable getException()
IStatus
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.
getException
in interface IStatus
null
if nonepublic String getMessage()
IStatus
getMessage
in interface IStatus
public String getPlugin()
IStatus
getPlugin
in interface IStatus
public int getSeverity()
IStatus
ERROR
- 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.
getSeverity
in interface IStatus
OK
,
ERROR
, INFO
, or WARNING
IStatus.matches(int)
public boolean isMultiStatus()
IStatus
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.
isMultiStatus
in interface IStatus
true
for a multi-status,
false
otherwiseIStatus.getChildren()
public boolean isOK()
IStatus
isOK
in interface IStatus
true
if this status has severity
OK
, and false
otherwisepublic boolean matches(int severityMask)
IStatus
matches
in interface IStatus
severityMask
- a mask formed by bitwise or'ing severity mask
constants (ERROR
, WARNING
,
INFO
)
true
if there is at least one match,
false
if there are no matchesIStatus.getSeverity()
,
IStatus.ERROR
,
IStatus.WARNING
,
IStatus.INFO
protected void setCode(int code)
code
- the plug-in-specific status code, or OK
protected void setException(Throwable exception)
exception
- a low-level exception, or null
if not
applicableprotected void setMessage(String message)
message
- a human-readable message, localized to the
current localeprotected void setPlugin(String pluginId)
pluginId
- the unique identifier of the relevant plug-inprotected void setSeverity(int severity)
severity
- the severity; one of OK
,
ERROR
, INFO
, or WARNING
public String toString()
toString
in class Object
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |