org.eclipse.wst.jsdt.core.refactoring.descriptors
Class JavaScriptRefactoringDescriptor

java.lang.Object
  extended by RefactoringDescriptor
      extended by org.eclipse.wst.jsdt.core.refactoring.descriptors.JavaScriptRefactoringDescriptor
Direct Known Subclasses:
ChangeMethodSignatureDescriptor, ConvertAnonymousDescriptor, ConvertLocalVariableDescriptor, ConvertMemberTypeDescriptor, CopyDescriptor, DeleteDescriptor, EncapsulateFieldDescriptor, ExtractConstantDescriptor, ExtractInterfaceDescriptor, ExtractLocalDescriptor, ExtractMethodDescriptor, ExtractSuperclassDescriptor, GeneralizeTypeDescriptor, InferTypeArgumentsDescriptor, InlineConstantDescriptor, InlineLocalVariableDescriptor, InlineMethodDescriptor, IntroduceFactoryDescriptor, IntroduceIndirectionDescriptor, IntroduceParameterDescriptor, MoveDescriptor, MoveMethodDescriptor, MoveStaticMembersDescriptor, PullUpDescriptor, PushDownDescriptor, RenameJavaScriptElementDescriptor, RenameLocalVariableDescriptor, RenameResourceDescriptor, UseSupertypeDescriptor

public abstract class JavaScriptRefactoringDescriptor
extends RefactoringDescriptor

Partial implementation of a java refactoring descriptor.

This class provides features common to all Java refactorings.

Note: this class is not intended to be extended outside the refactoring framework.

Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.


Field Summary
static int JAR_MIGRATION
          Constant describing the jar migration flag (value: 65536).
static int JAR_REFACTORING
          Constant describing the jar refactoring flag (value: 524288).
static int JAR_SOURCE_ATTACHMENT
          Constant describing the jar source attachment flag (value: 262144).
 
Method Summary
 Refactoring createRefactoring(RefactoringStatus status)
          
 void setComment(java.lang.String comment)
          Sets the details comment of this refactoring.
 void setDescription(java.lang.String description)
          Sets the description of this refactoring.
 void setFlags(int flags)
          Sets the flags of this refactoring.
 void setProject(java.lang.String project)
          Sets the project name of this refactoring.
 RefactoringStatus validateDescriptor()
          Validates the refactoring descriptor with respect to the constraints imposed by the represented refactoring.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAR_MIGRATION

public static final int JAR_MIGRATION
Constant describing the jar migration flag (value: 65536).

Clients should set this flag to indicate that the refactoring can be stored to a JAR file in order to be accessible to the Migrate JAR File refactoring, regardless whether there is a source attachment to the JAR file or not. If this flag is set, JAR_REFACTORING should be set as well.

See Also:
JAR_REFACTORING, Constant Field Values

JAR_REFACTORING

public static final int JAR_REFACTORING
Constant describing the jar refactoring flag (value: 524288).

Clients should set this flag to indicate that the refactoring in principle can be performed on binary elements originating from a JAR file. Refactorings which are able to run on binary elements, but require a correctly configured source attachment to work must set the JAR_SOURCE_ATTACHMENT flag as well.

See Also:
JAR_SOURCE_ATTACHMENT, Constant Field Values

JAR_SOURCE_ATTACHMENT

public static final int JAR_SOURCE_ATTACHMENT
Constant describing the jar source attachment flag (value: 262144).

Clients should set this flag to indicate that the refactoring can be performed on binary elements originating from a JAR file if and only if it has a correctly configured source attachment.

See Also:
JAR_REFACTORING, Constant Field Values
Method Detail

createRefactoring

public Refactoring createRefactoring(RefactoringStatus status)
                              throws CoreException

Throws:
CoreException

setComment

public void setComment(java.lang.String comment)
Sets the details comment of this refactoring.

This information is used in the user interface to show additional details about the performed refactoring. The default is to use no details comment.

Parameters:
comment - the details comment to set, or null to set no details comment
See Also:
#getComment()

setDescription

public void setDescription(java.lang.String description)
Sets the description of this refactoring.

This information is used to label a refactoring in the user interface. The default is an unspecified, but legal description.

Parameters:
description - the non-empty description of the refactoring to set
See Also:
#getDescription()

setFlags

public void setFlags(int flags)
Sets the flags of this refactoring.

The default is RefactoringDescriptor.STRUCTURAL_CHANGE | RefactoringDescriptor.MULTI_CHANGE, unless overridden by a concrete subclass. Clients may use refactoring flags to indicate special capabilities of Java refactorings.

Parameters:
flags - the flags to set, or RefactoringDescriptor.NONE to clear the flags
See Also:
#getFlags(), RefactoringDescriptor#NONE, RefactoringDescriptor#STRUCTURAL_CHANGE, RefactoringDescriptor#BREAKING_CHANGE, RefactoringDescriptor#MULTI_CHANGE, JAR_MIGRATION, JAR_REFACTORING, JAR_SOURCE_ATTACHMENT

setProject

public void setProject(java.lang.String project)
Sets the project name of this refactoring.

The default is to associate the refactoring with the workspace. Subclasses should call this method with the project name associated with the refactoring's input elements, if available.

Parameters:
project - the non-empty project name to set, or null for the workspace
See Also:
#getProject()

validateDescriptor

public RefactoringStatus validateDescriptor()
Validates the refactoring descriptor with respect to the constraints imposed by the represented refactoring.

Clients must call this method to verify that all arguments have been correctly set and that they satisfy the constraints imposed by specific refactorings. Returning a refactoring status of severity RefactoringStatus#FATAL indicates that the refactoring descriptor cannot be used to create a refactoring instance.

Returns:
a refactoring status describing the outcome of the validation