|
Eclipse Platform Release 3.2 |
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectorg.eclipse.ltk.core.refactoring.RefactoringDescriptor
Descriptor object of a refactoring.
A refactoring descriptor contains refactoring-specific data which allows the
framework to completely reconstruct a particular refactoring instance and
execute it on an arbitrary workspace. Refactoring descriptors are identified
by their refactoring id getID() and their time stamps
getTimeStamp().
Refactoring descriptors are potentially heavy weight objects which should not
be held on to. Use refactoring descriptor proxies
RefactoringDescriptorProxy to store refactoring information.
Clients which create specific refactoring descriptors during change generation should choose an informative description of the particular refactoring instance and pass appropriate descriptor flags to the constructor.
All time stamps are measured in UTC milliseconds from the epoch (see
java.util#Calendar).
Note: this class is indented to be subclassed by clients to provide specialized refactoring descriptors for particular refactorings.
RefactoringDescriptorProxy,
IRefactoringHistoryService| Field Summary | |
|---|---|
static int |
BREAKING_CHANGE
Constant describing the API change flag (value: 1) Clients should set this flag to indicate that the represented refactoring may cause breaking API changes. |
static String |
ID_UNKNOWN
The unknown refactoring id (value: org.eclipse.ltk.core.refactoring.unknown) This id is reserved by the refactoring framework to signal that a refactoring has been performed which did not deliver a refactoring descriptor via its Change.getDescriptor() method. |
static int |
MULTI_CHANGE
Constant describing the multi change flag (value: 4) Clients should set this flag to indicate that the change created by the represented refactoring might causes changes in other files than the files of the input elements according to the semantics of the associated programming language. |
static int |
NONE
Constant describing the absence of any flags (value: 0) |
static int |
STRUCTURAL_CHANGE
Constant describing the structural change flag (value: 2) Clients should set this flag to indicate that the change created by the represented refactoring might be a structural change according to the semantics of the associated programming language. |
static int |
USER_CHANGE
Constant describing the user flag (value: 256) This constant is not intended to be used in refactoring descriptors. |
| Constructor Summary | |
|---|---|
protected |
RefactoringDescriptor(String id,
String project,
String description,
String comment,
int flags)
Creates a new refactoring descriptor. |
| Method Summary | |
|---|---|
int |
compareTo(Object object)
|
abstract Refactoring |
createRefactoring(RefactoringStatus status)
Creates the a new refactoring instance for this refactoring descriptor. |
boolean |
equals(Object object)
|
String |
getComment()
Returns the comment associated with this refactoring. |
String |
getDescription()
Returns the description associated with this refactoring. |
int |
getFlags()
Returns the flags of this refactoring. |
String |
getID()
Returns the ID of the refactoring type used. |
String |
getProject()
Returns the name of the associated project. |
long |
getTimeStamp()
Returns the time stamp of this refactoring. |
int |
hashCode()
|
void |
setComment(String comment)
Sets the comment of this refactoring. |
void |
setProject(String project)
Sets the project of this refactoring. |
void |
setTimeStamp(long stamp)
Sets the time stamp of this refactoring. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int BREAKING_CHANGE
Clients should set this flag to indicate that the represented refactoring
may cause breaking API changes. If clients set the
BREAKING_CHANGE flag, they should set STRUCTURAL_CHANGE
as well.
public static final String ID_UNKNOWN
This id is reserved by the refactoring framework to signal that a
refactoring has been performed which did not deliver a refactoring
descriptor via its Change.getDescriptor() method. The refactoring
history service never returns unknown refactorings. For consistency
reasons, they are reported for IRefactoringExecutionListener or
IRefactoringHistoryListener in order to keep clients of these
listeners synchronized with the workbench's operation history.
public static final int MULTI_CHANGE
Clients should set this flag to indicate that the change created by the represented refactoring might causes changes in other files than the files of the input elements according to the semantics of the associated programming language.
public static final int NONE
public static final int STRUCTURAL_CHANGE
Clients should set this flag to indicate that the change created by the represented refactoring might be a structural change according to the semantics of the associated programming language.
public static final int USER_CHANGE
This constant is not intended to be used in refactoring descriptors. Clients should use the value of this constant to define user-defined flags with values greater than this constant.
| Constructor Detail |
protected RefactoringDescriptor(String id,
String project,
String description,
String comment,
int flags)
id - the unique id of the refactoringproject - the non-empty name of the project associated with this
refactoring, or null for a workspace
refactoringdescription - a non-empty human-readable description of the particular
refactoring instancecomment - the comment associated with the refactoring, or
null for no commentflags - the flags of the refactoring descriptor| Method Detail |
public final int compareTo(Object object)
compareTo in interface Comparable
public abstract Refactoring createRefactoring(RefactoringStatus status)
throws CoreException
This method is used by the refactoring framework to instantiate a refactoring from a refactoring descriptor, in order to apply it later on a local or remote workspace.
The returned refactoring must be in an initialized state, eg. ready to be
executed via PerformRefactoringOperation.
status - a refactoring status used to describe the outcome of the
initialization
null if this refactoring
descriptor represents the unknown refactoring, or if no
refactoring contribution is available for this refactoring
descriptor
CoreException - if an error occurs while creating the refactoring instancepublic final boolean equals(Object object)
public final String getComment()
public final String getDescription()
public final int getFlags()
public final String getID()
public final String getProject()
nullpublic final long getTimeStamp()
-1 if no time information is
availablepublic final int hashCode()
public final void setComment(String comment)
Note: This API must not be called from outside the refactoring framework.
comment - the non-empty comment to set, or nullpublic final void setProject(String project)
Note: This API must not be called from outside the refactoring framework.
project - the non-empty project name to set, or null for
the workspacepublic final void setTimeStamp(long stamp)
Note: This API must not be called from outside the refactoring framework.
stamp - the time stamp to setpublic String toString()
|
Eclipse Platform Release 3.2 |
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.