org.acm.seguin.refactor
Class EliminatePackageImportVisitor

java.lang.Object
  extended by org.acm.seguin.summary.TraversalVisitor
      extended by org.acm.seguin.refactor.type.TypeChangeVisitor
          extended by org.acm.seguin.refactor.EliminatePackageImportVisitor
All Implemented Interfaces:
SummaryVisitor

public class EliminatePackageImportVisitor
extends TypeChangeVisitor

Description of the Class

Author:
Chris Seguin

Constructor Summary
EliminatePackageImportVisitor(ComplexTransform complex)
          Constructor for the EliminatePackageImportVisitor object
 
Method Summary
 void addFilterClass(java.lang.String name)
          Adds a feature to the FilterClass attribute of the EliminatePackageImportVisitor object
protected  void addRenamingTransforms(ComplexTransform refactoring, FileSummary node, java.lang.String className)
          Gets the RenamingTransform
protected  java.util.LinkedList getAppropriateClasses(FileSummary node)
          Gets the list of classes to iterate over
protected  java.lang.String getCurrentPackage()
          Return the current package
protected  TransformAST getFileSpecificTransform(FileSummary summary)
          Gets the File Specific Transform
protected  java.io.File getNewFile(FileSummary node)
          Gets the reference to the file where the refactored output should be sent
protected  AddImportTransform getNewImports(FileSummary node, java.lang.String className)
          Gets the New Imports transform
protected  RemoveImportTransform getRemoveImportTransform(ImportSummary node)
          Gets the Remove Imports transform
protected  boolean preconditions(FileSummary summary)
          Checks any preconditions
 void setPackageSummary(PackageSummary summary)
          Sets the Package attribute of the EliminatePackageImportVisitor object
 
Methods inherited from class org.acm.seguin.refactor.type.TypeChangeVisitor
getState, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class org.acm.seguin.summary.TraversalVisitor
visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EliminatePackageImportVisitor

public EliminatePackageImportVisitor(ComplexTransform complex)
Constructor for the EliminatePackageImportVisitor object

Parameters:
complex - Description of Parameter
Method Detail

setPackageSummary

public void setPackageSummary(PackageSummary summary)
Sets the Package attribute of the EliminatePackageImportVisitor object

Parameters:
summary - The new Package value

addFilterClass

public void addFilterClass(java.lang.String name)
Adds a feature to the FilterClass attribute of the EliminatePackageImportVisitor object

Parameters:
name - The feature to be added to the FilterClass attribute

getFileSpecificTransform

protected TransformAST getFileSpecificTransform(FileSummary summary)
Gets the File Specific Transform

Specified by:
getFileSpecificTransform in class TypeChangeVisitor
Parameters:
summary - Description of Parameter
Returns:
The FileSpecificTransform value

getNewImports

protected AddImportTransform getNewImports(FileSummary node,
                                           java.lang.String className)
Gets the New Imports transform

Specified by:
getNewImports in class TypeChangeVisitor
Parameters:
node - Description of Parameter
className - Description of Parameter
Returns:
The NewImports value

getRemoveImportTransform

protected RemoveImportTransform getRemoveImportTransform(ImportSummary node)
Gets the Remove Imports transform

Specified by:
getRemoveImportTransform in class TypeChangeVisitor
Parameters:
node - Description of Parameter
Returns:
The transform

getAppropriateClasses

protected java.util.LinkedList getAppropriateClasses(FileSummary node)
Gets the list of classes to iterate over

Specified by:
getAppropriateClasses in class TypeChangeVisitor
Parameters:
node - Description of Parameter
Returns:
The list

getNewFile

protected java.io.File getNewFile(FileSummary node)
Gets the reference to the file where the refactored output should be sent

Specified by:
getNewFile in class TypeChangeVisitor
Parameters:
node - Description of Parameter
Returns:
The NewFile value

getCurrentPackage

protected java.lang.String getCurrentPackage()
Return the current package

Specified by:
getCurrentPackage in class TypeChangeVisitor
Returns:
the current package of the class

preconditions

protected boolean preconditions(FileSummary summary)
Checks any preconditions

Overrides:
preconditions in class TypeChangeVisitor
Parameters:
summary - Description of Parameter
Returns:
Description of the Returned Value

addRenamingTransforms

protected void addRenamingTransforms(ComplexTransform refactoring,
                                     FileSummary node,
                                     java.lang.String className)
Gets the RenamingTransform

Specified by:
addRenamingTransforms in class TypeChangeVisitor
Parameters:
refactoring - The feature to be added to the RenamingTransforms attribute
node - The feature to be added to the RenamingTransforms attribute
className - The feature to be added to the RenamingTransforms attribute