org.prorefactor.refactor.action
Class RenameSchema

java.lang.Object
  extended by org.prorefactor.refactor.action.RenameSchema

public class RenameSchema
extends java.lang.Object

Rename schema tables and fields from an input from/to name mapping. Database name changes are not supported (logical, alias, or otherwise). Buffer names are not changed. Input names map is a string of old/new name pairs, all separated by any sort of whitespace (space, tab, newline,...). The "old" names must be either "db.table" or "db.table.field". Any qualifier on the "new" name is completely ignored. Any database qualifier from the original source code is retained. For fields, any table qualifier is retained from the original source code. Table and field names can be changed at the same time - any table qualifier on a field would be changed as long as it is not for a named buffer.


Nested Class Summary
 class RenameSchema.Changer
           
 class RenameSchema.RenameTarget
           
 
Constructor Summary
RenameSchema(java.lang.String namesMap, java.lang.String outDir)
          See the class notes for details about the format of the input names map
 
Method Summary
 int run(java.io.File compileFile, java.lang.String relPath)
          Run this refactor for an input compile unit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenameSchema

public RenameSchema(java.lang.String namesMap,
                    java.lang.String outDir)
             throws RefactorException
See the class notes for details about the format of the input names map

Throws:
RefactorException - if there are any invalid "old" names in the map.
Method Detail

run

public int run(java.io.File compileFile,
               java.lang.String relPath)
        throws RefactorException,
               java.io.IOException
Run this refactor for an input compile unit.

Parameters:
relPath - The path/filename, relative to the project directory.
Returns:
the number of refactor targets attempted
Throws:
RefactorException
java.io.IOException


Copyright © 2008 Joanju Software. All Rights Reserved.