Package org.eclipse.ltk.core.refactoring
Class RefactoringStatusEntry
- java.lang.Object
-
- org.eclipse.ltk.core.refactoring.RefactoringStatusEntry
-
public class RefactoringStatusEntry extends Object
An immutable object representing an entry in the list inRefactoringStatus
. 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.
- Since:
- 3.0
- Restriction:
- This class is not intended to be subclassed by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static int
NO_CODE
A special problem code indicating that no problem code is provided.
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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, ornull
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 anIStatus
.String
toString()
-
-
-
Field Detail
-
NO_CODE
public static final int NO_CODE
A special problem code indicating that no problem code is provided. IfNO_CODE
is used then the plug-in identifier can benull
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RefactoringStatusEntry
public RefactoringStatusEntry(int severity, String msg)
Creates a new refactoring status entry. The context is set tonull
the problem code is set toNO_CODE
, the plug-in identifier is set tonull
and the data pointer is set tonull
as well.- Parameters:
severity
- the severitymsg
- the message
-
RefactoringStatusEntry
public RefactoringStatusEntry(int severity, String msg, RefactoringStatusContext context)
Creates a new refactoring status entry. The problem code is set toNO_CODE
, the plug-in identifier is set tonull
and the data pointer is set tonull
as well.- Parameters:
severity
- the severitymsg
- the messagecontext
- the context. Can benull
-
RefactoringStatusEntry
public RefactoringStatusEntry(int severity, String msg, RefactoringStatusContext context, String pluginId, int code)
Creates a new refactoring status entry.- Parameters:
severity
- the severitymsg
- the messagecontext
- the context. Can benull
pluginId
- the plug-in identifier. Can benull
if argumentcode
equalsNO_CODE
code
- the problem code. Must be eitherNO_CODE
or equals or greater than zero
-
RefactoringStatusEntry
public RefactoringStatusEntry(int severity, String msg, RefactoringStatusContext context, String pluginId, int code, Object data)
Creates a new refactoring status entry.- Parameters:
severity
- the severitymsg
- the messagecontext
- the context. Can benull
pluginId
- the plug-in identifier. Can benull
if argumentcode
equalsNO_CODE
code
- the problem code. Must be eitherNO_CODE
or a positive integerdata
- application specific data
-
-
Method Detail
-
getMessage
public String getMessage()
Returns the message of the status entry.- Returns:
- the message
-
getSeverity
public int getSeverity()
Returns the severity level.- Returns:
- the severity level
- See Also:
RefactoringStatus.INFO
,RefactoringStatus.WARNING
,RefactoringStatus.ERROR
,RefactoringStatus.FATAL
-
getContext
public RefactoringStatusContext getContext()
Returns the context which can be used to show more detailed information regarding this status entry in the UI. The method may returnnull
indicating that no context is available.- Returns:
- the status entry's context
-
getPluginId
public String getPluginId()
Returns the plug-in identifier associated with the problem code. Might returnnull
if the problem code equalsNO_CODE
.- Returns:
- the plug-in identifier
-
getCode
public int getCode()
Returns the problem code.- Returns:
- the problem code
-
getData
public Object getData()
Returns the application defined entry data associated with the receiver, ornull
if it has not been set.- Returns:
- the entry data
-
isFatalError
public boolean isFatalError()
Returns whether the entry represents a fatal error or not.- Returns:
true
if (severity ==RefactoringStatus.FATAL
)
-
isError
public boolean isError()
Returns whether the entry represents an error or not.- Returns:
true
if (severity ==RefactoringStatus.ERROR
).
-
isWarning
public boolean isWarning()
Returns whether the entry represents a warning or not.- Returns:
true
if (severity ==RefactoringStatus.WARNING
).
-
isInfo
public boolean isInfo()
Returns whether the entry represents an information or not.- Returns:
true
if (severity ==RefactoringStatus.INFO
).
-
toStatus
public IStatus toStatus()
Returns this refactoring status entry as anIStatus
.If this refactoring status entry has a severity of
RefactoringStatus.FATAL
, the returned status will have a severity ofIStatus.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 idorg.eclipse.ltk.core.refactoring
will be used in the returned status.- Returns:
- the corresponding status
- Since:
- 3.2
-
-