|
Eclipse JDT Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ltk.core.refactoring.RefactoringStatus
A RefactoringStatus
object represents the outcome of a
condition checking operation. It manages a list of
RefactoringStatusEntry
objects. Each RefactoringStatusEntry
object describes one particular problem detected during
condition checking.
Additionally a problem severity is managed. Severities are ordered as follows:
OK
< INFO
< WARNING
<
ERROR
< FATAL
. The status's problem severity is the maximum
of the severities of all entries. If the status doesn't have any entry the status's
severity is OK
.
Note: this class is not intended to be extended by clients.
RefactoringStatusEntry
,
Refactoring.checkAllConditions(IProgressMonitor)
Field Summary | |
static int |
ERROR
Status severity constant (value 3) indicating this status represents an error. |
static int |
FATAL
Status severity constant (value 4) indicating this status represents a fatal error. |
static int |
INFO
Status severity constant (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 severity constant (value 2) indicating this status represents a warning. |
Constructor Summary | |
RefactoringStatus()
Creates a new refactoring status with an empty list of status entries and a severity of OK . |
Method Summary | |
void |
addEntry(int severity,
String msg,
RefactoringStatusContext context,
String pluginId,
int code)
Adds a new entry filled with the given arguments to this status. |
void |
addEntry(int severity,
String msg,
RefactoringStatusContext context,
String pluginId,
int code,
Object data)
Adds a new entry filled with the given arguments to this status. |
void |
addEntry(RefactoringStatusEntry entry)
Adds the given RefactoringStatusEntry . |
void |
addError(String msg)
Adds an ERROR entry filled with the given message to this status.
|
void |
addError(String msg,
RefactoringStatusContext context)
Adds an ERROR entry filled with the given message and context to
this status. |
void |
addFatalError(String msg)
Adds a FATAL entry filled with the given message to this status.
|
void |
addFatalError(String msg,
RefactoringStatusContext context)
Adds a FATAL entry filled with the given message and status to
this status. |
void |
addInfo(String msg)
Adds an INFO entry filled with the given message to this status.
|
void |
addInfo(String msg,
RefactoringStatusContext context)
Adds an INFO entry filled with the given message and context to
this status. |
void |
addWarning(String msg)
Adds a WARNING entry filled with the given message to this status.
|
void |
addWarning(String msg,
RefactoringStatusContext context)
Adds a WARNING entry filled with the given message and context to
this status. |
static RefactoringStatus |
create(IStatus status)
Creates a new RefactorngStatus from the given IStatus . |
static RefactoringStatus |
createErrorStatus(String msg)
Creates a new RefactorngStatus with one ERROR entry
filled with the given message. |
static RefactoringStatus |
createErrorStatus(String msg,
RefactoringStatusContext context)
Creates a RefactorngStatus with one ERROR entry
fill with the given message and context. |
static RefactoringStatus |
createFatalErrorStatus(String msg)
Creates a new RefactorngStatus with one FATAL entry
filled with the given message. |
static RefactoringStatus |
createFatalErrorStatus(String msg,
RefactoringStatusContext context)
Creates a RefactorngStatus with one FATAL entry
fill with the given message and context. |
static RefactoringStatus |
createInfoStatus(String msg)
Creates a new RefactorngStatus with one INFO entry
filled with the given message. |
static RefactoringStatus |
createInfoStatus(String msg,
RefactoringStatusContext context)
Creates a new RefactorngStatus with one INFO entry
filled with the given message and context. |
static RefactoringStatus |
createStatus(int severity,
String msg,
RefactoringStatusContext context,
String pluginId,
int code,
Object data)
Creates a new RefactoringStatus with one entry filled with the given
arguments. |
static RefactoringStatus |
createWarningStatus(String msg)
Creates a new RefactorngStatus with one WARNING entry
filled with the given message. |
static RefactoringStatus |
createWarningStatus(String msg,
RefactoringStatusContext context)
Creates a RefactorngStatus with one WARNING entry
fill with the given message and context. |
RefactoringStatusEntry[] |
getEntries()
Returns the list of refactoring status entries. |
RefactoringStatusEntry |
getEntryAt(int index)
Returns the RefactoringStatusEntry at the specified index. |
RefactoringStatusEntry |
getEntryMatchingCode(String pluginId,
int code)
Returns the first entry managed by this refactoring status that matches the given plug-in identifier and code. |
RefactoringStatusEntry |
getEntryMatchingSeverity(int severity)
Returns the first entry which severity is equal or greater than the given severity. |
String |
getMessageMatchingSeverity(int severity)
Returns the first message which severity is equal or greater than the given severity. |
int |
getSeverity()
Returns the severity. |
boolean |
hasEntries()
Returns whether the status has entries or not. |
boolean |
hasError()
Returns true if the current severity is
FATAL or ERROR . |
boolean |
hasFatalError()
Returns true if the current severity is
FATAL . |
boolean |
hasInfo()
Returns true if the current severity is
FATAL , ERROR , WARNING or
INFO . |
boolean |
hasWarning()
Returns true if the current severity is
FATAL , ERROR or WARNING . |
boolean |
isOK()
Returns whether the status's severity is OK or not. |
void |
merge(RefactoringStatus other)
Merges the receiver and the parameter statuses. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int OK
public static final int INFO
public static final int WARNING
public static final int ERROR
public static final int FATAL
Constructor Detail |
public RefactoringStatus()
OK
.
Method Detail |
public int getSeverity()
public RefactoringStatusEntry[] getEntries()
public boolean hasEntries()
true
if the status as any entries; otherwise
false
is returned.public RefactoringStatusEntry getEntryAt(int index)
RefactoringStatusEntry
at the specified index.
index
- the index of the entry to return
IndexOutOfBoundsException
- if the index is out of rangepublic RefactoringStatusEntry getEntryMatchingCode(String pluginId, int code)
null
if no entry
matches.
pluginId
- the entry's plug-in identifiercode
- the entry's code
null
otherwisepublic RefactoringStatusEntry getEntryMatchingSeverity(int severity)
null
if no
entry matches.
severity
- the severity to search for. Must be one of FATAL
, ERROR
, WARNING
or INFO
public String getMessageMatchingSeverity(int severity)
null
if no entry matches.
severity
- the severity to search for. Must be one of FATAL
, ERROR
, WARNING
or INFO
public static RefactoringStatus createStatus(int severity, String msg, RefactoringStatusContext context, String pluginId, int code, Object data)
RefactoringStatus
with one entry filled with the given
arguments.
severity
- the severitymsg
- the messagecontext
- the context. Can be null
pluginId
- the plug-in identifier. Can be null
if argument
code
equals NO_CODE
code
- the problem code. Must be either NO_CODE
or a positive integerdata
- application specific data
RefactoringStatusEntry
public static RefactoringStatus createInfoStatus(String msg)
RefactorngStatus
with one INFO
entry
filled with the given message.
msg
- the message of the info entry
RefactoringStatusEntry
public static RefactoringStatus createInfoStatus(String msg, RefactoringStatusContext context)
RefactorngStatus
with one INFO
entry
filled with the given message and context.
msg
- the message of the info entrycontext
- the context of the info entry
RefactoringStatusEntry
public static RefactoringStatus createWarningStatus(String msg)
RefactorngStatus
with one WARNING
entry
filled with the given message.
msg
- the message of the warning entry
RefactoringStatusEntry
public static RefactoringStatus createWarningStatus(String msg, RefactoringStatusContext context)
RefactorngStatus
with one WARNING
entry
fill with the given message and context.
msg
- the message of the warning entrycontext
- the context of the warning entry
RefactoringStatusEntry
public static RefactoringStatus createErrorStatus(String msg)
RefactorngStatus
with one ERROR
entry
filled with the given message.
msg
- the message of the error entry
RefactoringStatusEntry
public static RefactoringStatus createErrorStatus(String msg, RefactoringStatusContext context)
RefactorngStatus
with one ERROR
entry
fill with the given message and context.
msg
- the message of the error entrycontext
- the context of the error entry
RefactoringStatusEntry
public static RefactoringStatus createFatalErrorStatus(String msg)
RefactorngStatus
with one FATAL
entry
filled with the given message.
msg
- the message of the fatal entry
RefactoringStatusEntry
public static RefactoringStatus createFatalErrorStatus(String msg, RefactoringStatusContext context)
RefactorngStatus
with one FATAL
entry
fill with the given message and context.
msg
- the message of the fatal entrycontext
- the context of the fatal entry
RefactoringStatusEntry
public static RefactoringStatus create(IStatus status)
RefactorngStatus
from the given IStatus
. An
OK status is mapped to an OK refactoring status, an information status is mapped
to a warning refactoring status, a warning status is mapped to an error refactoring
status and an error or cancel status is mapped to a fatal refactoring status. An unknown
status is converted into a fatal error status as well. If the status is a MultiStatus
then the first level of children of the status will be added as refactoring status
entries to the created refactoring status.
status
- the status to create a refactoring status from
IStatus
public void merge(RefactoringStatus other)
null
is
allowed - it has no effect.
other
- the refactoring status to merge withpublic void addInfo(String msg)
INFO
entry filled with the given message to this status.
If the current severity is OK
it will be changed to INFO
. It will remain unchanged otherwise.
msg
- the message of the info entryRefactoringStatusEntry
public void addInfo(String msg, RefactoringStatusContext context)
INFO
entry filled with the given message and context to
this status. If the current severity is OK
it will be changed to
INFO
. It will remain unchanged otherwise.
msg
- the message of the info entrycontext
- the context of the info entryRefactoringStatusEntry
public void addWarning(String msg)
WARNING
entry filled with the given message to this status.
If the current severity is OK
or INFO
it will be
changed to WARNING
. It will remain unchanged otherwise.
msg
- the message of the warning entryRefactoringStatusEntry
public void addWarning(String msg, RefactoringStatusContext context)
WARNING
entry filled with the given message and context to
this status. If the current severity is OK
or INFO
it
will be changed to WARNING
. It will remain unchanged otherwise.
msg
- the message of the warning entrycontext
- the context of the warning entryRefactoringStatusEntry
public void addError(String msg)
ERROR
entry filled with the given message to this status.
If the current severity is OK
, INFO
or WARNING
it will be changed to ERROR
. It will remain unchanged
otherwise.
msg
- the message of the error entryRefactoringStatusEntry
public void addError(String msg, RefactoringStatusContext context)
ERROR
entry filled with the given message and context to
this status. If the current severity is OK
, INFO
or
WARNING
it will be changed to ERROR
. It will remain
unchanged otherwise.
msg
- the message of the error entrycontext
- the context of the error entryRefactoringStatusEntry
public void addFatalError(String msg)
FATAL
entry filled with the given message to this status.
The severity of this status will changed to FATAL
.
msg
- the message of the fatal entryRefactoringStatusEntry
public void addFatalError(String msg, RefactoringStatusContext context)
FATAL
entry filled with the given message and status to
this status. The severity of this status will changed to FATAL
.
msg
- the message of the fatal entrycontext
- the context of the fatal entryRefactoringStatusEntry
public void addEntry(int severity, String msg, RefactoringStatusContext context, String pluginId, int code)
fSeverity
and
severity
.
severity
- the severity of the entrymsg
- the message of the entrycontext
- the context of the entry. Can be null
pluginId
- the plug-in identifier of the entry. Can be null
if
argument code
equals NO_CODE
code
- the problem code of the entry. Must be either NO_CODE
or a positive integerpublic void addEntry(int severity, String msg, RefactoringStatusContext context, String pluginId, int code, Object data)
fSeverity
and
severity
.
severity
- the severity of the entrymsg
- the message of the entrycontext
- the context of the entry. Can be null
pluginId
- the plug-in identifier of the entry. Can be null
if
argument code
equals NO_CODE
code
- the problem code of the entry. Must be either NO_CODE
or a positive integerdata
- application specific data of the entrypublic void addEntry(RefactoringStatusEntry entry)
RefactoringStatusEntry
. The severity of this
status is set to the maximum of fSeverity
and the severity of
the entry.
entry
- the RefactoringStatusEntry
to be addedpublic boolean isOK()
OK
or not.
true
if the severity is OK
;
otherwise false
is returnedpublic boolean hasFatalError()
true
if the current severity is
FATAL
.
true
if the current severity is
FATAL
; otherwise false
is returnedpublic boolean hasError()
true
if the current severity is
FATAL
or ERROR
.
true
if the current severity is
FATAL
or ERROR
; otherwise false
is returnedpublic boolean hasWarning()
true
if the current severity is
FATAL
, ERROR
or WARNING
.
true
if the current severity is
FATAL
, ERROR
or WARNING
;
otherwise false
is returnedpublic boolean hasInfo()
true
if the current severity is
FATAL
, ERROR
, WARNING
or
INFO
.
true
if the current severity is
FATAL
, ERROR
, WARNING
or
INFO
; otherwise false
is returnedpublic String toString()
|
Eclipse JDT Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |