Eclipse Platform
2.0

org.eclipse.core.runtime
Interface IStatus

All Known Subinterfaces:
IResourceStatus
All Known Implementing Classes:
Status

public interface IStatus

A status object represents the outcome of an operation. All 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.

See Also:
MultiStatus, Status

Field Summary
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.
 
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.
 

Field Detail

OK

public static final int OK
Status severity constant (value 0) indicating this status represents the nominal case. This constant is also used as the status code representing the nominal case.

See Also:
getSeverity(), isOK(), Constant Field Values

INFO

public static final int INFO
Status type severity (bit mask, value 1) indicating this status is informational only.

See Also:
getSeverity(), matches(int), Constant Field Values

WARNING

public static final int WARNING
Status type severity (bit mask, value 2) indicating this status represents a warning.

See Also:
getSeverity(), matches(int), Constant Field Values

ERROR

public static final int ERROR
Status type severity (bit mask, value 4) indicating this status represents an error.

See Also:
getSeverity(), matches(int), Constant Field Values
Method Detail

getChildren

public 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.

Returns:
an array of status objects
See Also:
isMultiStatus()

getCode

public int getCode()
Returns the plug-in-specific status code describing the outcome.

Returns:
plug-in-specific status code

getException

public Throwable getException()
Returns the relevant low-level exception, or 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.

Returns:
the relevant low-level exception, or null if none

getMessage

public String getMessage()
Returns the message describing the outcome. The message is localized to the current locale.

Returns:
a localized message

getPlugin

public 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).

Returns:
the unique identifier of the relevant plug-in

getSeverity

public int getSeverity()
Returns the severity. The severities are as follows (in descending order):

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.

Returns:
the severity: one of OK, ERROR, INFO, or WARNING
See Also:
matches(int)

isMultiStatus

public boolean isMultiStatus()
Returns whether this status is a multi-status. A multi-status describes the outcome of an operation involving multiple operands.

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.

Returns:
true for a multi-status, false otherwise
See Also:
getChildren()

isOK

public boolean isOK()
Returns whether this status indicates everything is okay (neither info, warning, nor error).

Returns:
true if this status has severity OK, and false otherwise

matches

public boolean matches(int severityMask)
Returns whether the severity of this status matches the given specification.

Parameters:
severityMask - a mask formed by bitwise or'ing severity mask constants (ERROR, WARNING, INFO)
Returns:
true if there is at least one match, false if there are no matches
See Also:
getSeverity(), ERROR, WARNING, INFO

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.