public class RefactoringStatusEntry extends Object
RefactoringStatus
.
A refactoring status entry consists of a severity, a message, a problem code
(represented by a tuple(plug-in identifier and code number)), a context object and a
generic data pointer. The context object is used to provide context information for
the problem itself. An example context is a tuple consisting of the resource that contains
the problem and a corresponding line number.
Note: this class is not intended to be extended by clients.
Modifier and Type | Field and Description |
---|---|
static int |
NO_CODE
A special problem code indicating that no problem code is provided.
|
Constructor and Description |
---|
RefactoringStatusEntry(int severity,
String msg)
Creates a new refactoring status entry.
|
RefactoringStatusEntry(int severity,
String msg,
RefactoringStatusContext context)
Creates a new refactoring status entry.
|
RefactoringStatusEntry(int severity,
String msg,
RefactoringStatusContext context,
String pluginId,
int code)
Creates a new refactoring status entry.
|
RefactoringStatusEntry(int severity,
String msg,
RefactoringStatusContext context,
String pluginId,
int code,
Object data)
Creates a new refactoring status entry.
|
Modifier and Type | Method and Description |
---|---|
int |
getCode()
Returns the problem code.
|
RefactoringStatusContext |
getContext()
Returns the context which can be used to show more detailed information regarding
this status entry in the UI.
|
Object |
getData()
Returns the application defined entry data associated
with the receiver, or
null if it has not
been set. |
String |
getMessage()
Returns the message of the status entry.
|
String |
getPluginId()
Returns the plug-in identifier associated with the
problem code.
|
int |
getSeverity()
Returns the severity level.
|
boolean |
isError()
Returns whether the entry represents an error or not.
|
boolean |
isFatalError()
Returns whether the entry represents a fatal error or not.
|
boolean |
isInfo()
Returns whether the entry represents an information or not.
|
boolean |
isWarning()
Returns whether the entry represents a warning or not.
|
IStatus |
toStatus()
Returns this refactoring status entry as an
IStatus . |
String |
toString() |
public static final int NO_CODE
NO_CODE
is used then the plug-in identifier can be
null
public RefactoringStatusEntry(int severity, String msg)
null
the problem code is set to NO_CODE
, the
plug-in identifier is set to null
and the data pointer
is set to null
as well.severity
- the severitymsg
- the messagepublic RefactoringStatusEntry(int severity, String msg, RefactoringStatusContext context)
NO_CODE
, the plug-in identifier is set to null
and
the data pointer is set to null
as well.severity
- the severitymsg
- the messagecontext
- the context. Can be null
public RefactoringStatusEntry(int severity, String msg, RefactoringStatusContext context, String pluginId, int code)
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 equals or greater
than zeropublic RefactoringStatusEntry(int severity, String msg, RefactoringStatusContext context, String pluginId, int code, Object data)
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 datapublic String getMessage()
public int getSeverity()
RefactoringStatus.INFO
,
RefactoringStatus.WARNING
,
RefactoringStatus.ERROR
,
RefactoringStatus.FATAL
public RefactoringStatusContext getContext()
null
indicating
that no context is available.public String getPluginId()
null
if the
problem code equals NO_CODE
.public int getCode()
public Object getData()
null
if it has not
been set.public boolean isFatalError()
true
if (severity ==RefactoringStatus.FATAL
)public boolean isError()
true
if (severity ==RefactoringStatus.ERROR
).public boolean isWarning()
true
if (severity ==RefactoringStatus.WARNING
).public boolean isInfo()
true
if (severity ==RefactoringStatus.INFO
).public IStatus toStatus()
IStatus
.
If this refactoring status entry has a severity of
RefactoringStatus.FATAL
, the returned status will have a
severity of IStatus.ERROR
, otherwise a status with severity
corresponding to the refactoring status entry is returned. If the plugin
id of this refactoring status entry is not defined, the plugin id
org.eclipse.ltk.core.refactoring
will be used in the
returned status.
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.