|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.core.runtime.Status
public class Status
A concrete status implementation, suitable either for instantiating or subclassing.
This class can be used without OSGi running.
| Field Summary | |
|---|---|
static IStatus |
CANCEL_STATUS
A standard CANCEL status with no message. |
static IStatus |
OK_STATUS
A standard OK status with an "ok" message. |
| Fields inherited from interface org.eclipse.core.runtime.IStatus |
|---|
CANCEL, ERROR, INFO, OK, WARNING |
| Constructor Summary | |
|---|---|
Status(int severity,
java.lang.String pluginId,
int code,
java.lang.String message,
java.lang.Throwable exception)
Creates a new status object. |
|
Status(int severity,
java.lang.String pluginId,
java.lang.String message)
Simplified constructor of a new status object; assumes that code is OK and
exception is null. |
|
Status(int severity,
java.lang.String pluginId,
java.lang.String message,
java.lang.Throwable exception)
Simplified constructor of a new status object; assumes that code is OK. |
|
| 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. |
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. |
protected void |
setCode(int code)
Sets the status code. |
protected void |
setException(java.lang.Throwable exception)
Sets the exception. |
protected void |
setMessage(java.lang.String message)
Sets the message. |
protected void |
setPlugin(java.lang.String pluginId)
Sets the plug-in id. |
protected void |
setSeverity(int severity)
Sets the severity. |
java.lang.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 |
| Field Detail |
|---|
public static final IStatus OK_STATUS
public static final IStatus CANCEL_STATUS
| Constructor Detail |
|---|
public Status(int severity,
java.lang.String pluginId,
int code,
java.lang.String message,
java.lang.Throwable exception)
severity - the severity; one of OK, ERROR,
INFO, WARNING, or CANCELpluginId - the unique identifier of the relevant plug-incode - the plug-in-specific status code, or OKmessage - a human-readable message, localized to the
current localeexception - a low-level exception, or null if not
applicable
public Status(int severity,
java.lang.String pluginId,
java.lang.String message,
java.lang.Throwable exception)
OK.
The created status has no children.
severity - the severity; one of OK, ERROR,
INFO, WARNING, or CANCELpluginId - the unique identifier of the relevant plug-inmessage - a human-readable message, localized to the
current localeexception - a low-level exception, or null if not
applicable
public Status(int severity,
java.lang.String pluginId,
java.lang.String message)
OK and
exception is null. The created status has no children.
severity - the severity; one of OK, ERROR,
INFO, WARNING, or CANCELpluginId - the unique identifier of the relevant plug-inmessage - a human-readable message, localized to the
current locale| Method Detail |
|---|
public IStatus[] getChildren()
IStatus
getChildren in interface IStatusIStatus.isMultiStatus()public int getCode()
IStatus
getCode in interface IStatuspublic java.lang.Throwable getException()
IStatusnull 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 IStatusnull if nonepublic java.lang.String getMessage()
IStatus
getMessage in interface IStatuspublic java.lang.String getPlugin()
IStatus
getPlugin in interface IStatuspublic int getSeverity()
IStatusCANCEL - 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.
getSeverity in interface IStatusOK, ERROR,
INFO, WARNING, or CANCELIStatus.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 IStatustrue for a multi-status,
false otherwiseIStatus.getChildren()public boolean isOK()
IStatus
isOK in interface IStatustrue if this status has severity
OK, and false otherwisepublic boolean matches(int severityMask)
IStatusOK
will never match; use isOK instead to detect
a status with a severity of OK.
matches in interface IStatusseverityMask - 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 matchesIStatus.getSeverity(),
IStatus.CANCEL,
IStatus.ERROR,
IStatus.WARNING,
IStatus.INFOprotected void setCode(int code)
code - the plug-in-specific status code, or OKprotected void setException(java.lang.Throwable exception)
exception - a low-level exception, or null if not
applicableprotected void setMessage(java.lang.String message)
message - a human-readable message, localized to the
current localeprotected void setPlugin(java.lang.String pluginId)
pluginId - the unique identifier of the relevant plug-inprotected void setSeverity(int severity)
severity - the severity; one of OK, ERROR,
INFO, WARNING, or CANCELpublic java.lang.String toString()
toString in class java.lang.Object
|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.