Eclipse Platform
Release 3.2

org.eclipse.ltk.core.refactoring
Class RefactoringContribution

java.lang.Object
  extended byorg.eclipse.ltk.core.refactoring.RefactoringContribution

public abstract class RefactoringContribution
extends Object

Partial implementation of refactoring contribution objects which are capable of creating refactoring descriptors or refactoring arguments.

Clients which would like to add refactoring history and refactoring scripting support to a refactoring are required to register a subclass of RefactoringContribution with the extension point org.eclipse.ltk.core.refactoring.refactoringContributions to participate in the refactoring services. Refactoring contributions are stateless objects. They are instantiated on demand by the refactoring framework in the following cases:

Refactorings for which a refactoring contribution has been registered should also return a RefactoringDescriptor during change generation (ie. returning a change object whose Change.getDescriptor() method has been implemented to return a RefactoringChangeDescriptor encapsulating RefactoringDescriptor.

Note: Clients which extend this class are required to reimplement the method retrieveArgumentMap(RefactoringDescriptor) in subclasses to capture the state of a language-specific refactoring descriptor in a neutral key-value representation used by the refactoring framework.

Since:
3.2

Constructor Summary
RefactoringContribution()
           
 
Method Summary
abstract  RefactoringDescriptor createDescriptor(String id, String project, String description, String comment, Map arguments, int flags)
          Creates a new refactoring descriptor.
 Map retrieveArgumentMap(RefactoringDescriptor descriptor)
          Retrieves the argument map of the specified refactoring descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RefactoringContribution

public RefactoringContribution()
Method Detail

createDescriptor

public abstract RefactoringDescriptor createDescriptor(String id,
                                                       String project,
                                                       String description,
                                                       String comment,
                                                       Map arguments,
                                                       int flags)
Creates a new refactoring descriptor.

This method is used by the refactoring framework to create a language-specific refactoring descriptor representing the refactoring instance corresponding to the specified arguments. Implementations of this method must never return null. The refactoring framework guarantees that this method is only called with id values for which the refactoring contribution has been registered with the extension point.

Parameters:
id - the unique id of the refactoring
project - the non-empty name of the project associated with this refactoring, or null for a workspace refactoring
description - a non-empty human-readable description of the particular refactoring instance
comment - the comment associated with the refactoring, or null for no comment
arguments - the argument map (element type: <String, String>). The keys of the arguments are required to be non-empty strings which must not contain spaces. The values must be non-empty strings
flags - the flags of the refactoring descriptor
Returns:
the refactoring descriptor
See Also:
retrieveArgumentMap(RefactoringDescriptor)

retrieveArgumentMap

public Map retrieveArgumentMap(RefactoringDescriptor descriptor)
Retrieves the argument map of the specified refactoring descriptor.

This method is used by the refactoring framework to obtain refactoring-specific arguments provided by the refactoring descriptor. These are the arguments which are specific to certain refactoring instances, and correspond to the argument map which has been passed to createDescriptor(String, String, String, String, Map, int) upon creation of the refactoring descriptor.

The returned argument map (element type: <String, String>) must satisfy the following conditions:

Subclasses must extend this method to provide more specific implementation in order to let the refactoring framework retrieve the argument map from language-specific refactoring descriptors. Implementations of this method must never return null. The refactoring framework guarantees that this method is only called for refactoring descriptors which have been obtained by a previous call to createDescriptor(String, String, String, String, Map, int).

Parameters:
descriptor - the refactoring descriptor to retrieve its argument map
Returns:
the argument map of the specified refactoring descriptor
See Also:
createDescriptor(String, String, String, String, Map, int)

Eclipse Platform
Release 3.2

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.