FeaturesPluginsDocs & SupportCommunityPartners

Extract Interface Refactoring Specification

$Id: extractinterface.html,v 1.6 2005/08/11 09:06:51 jbecicka Exp $ (see full CVS history)

This refactoring feature allows to create an interface based on a given class.
Implementation of this refactoring is tracked in issue 57430.

Pre-Conditions

  1. A java class or interface is selected.

Pre-Checks

No specific checks.

Parameters

  1. Name of the new interface.
  2. Interfaces (that the base class implements or that the base interface inherits from) that should the new interface extend.
  3. Public methods and public static fields (from the base class or base interface) that should the new interface declare.

Fast Parameters Check


No specific checks.

Parameters Check

  1. [4.2] Error: The entered name for the interface causes a name clash.

Changes To Be Made

  1. The new interface with the selected methods and fields is created in the same package as the base class/interface.
  2. The implements/extends clause of the base class/interface is updated to include the new interface and to exclude the interfaces that the new interface extends.
  3. The selected static public fields are removed from the base class.

Checks During Changes Preparation

No specific checks.

Refactoring UI

Menu item: Extract Interface...
Action title: Extract Interface - ClassName

The panel should display a text field for name of the new interface and a table which includes interfaces that are inherited by the base class/interface and a public non-static methods and public static fields and static Inner Classes from the base class/interface. Elements in the table can be checked meaining they should be included into the selection.

-----------------------------------------------
| Super Interface Name: _NewInterface_______  |
|                                             |
| Members to Extract:                         | 
| ------------------------------------------- |
| |  | Member                               | |
| |-----------------------------------------| |
| | o doJob                                 | |
| | x counter                               | |      
| | o InnerClass                            | |
| | o implements IFoo                       | |
| | o implements IBar                       | |
| |                                         | |
| ------------------------------------------- |
-----------------------------------------------
Companion
Projects:
MySQL Database Server   Open JDK: an Open SourceJDK   GlassFish Community: an Open Source Application Server    Mobile & Embedded Community    Open Solaris   java.net - The Source for Java Technology Collaboration   Virtual Box - full virtualizer  Open ESB - The Open Enterprise Service Bus Powered by