org.prorefactor.refactor.substitute
Class SubstituteRefactor

java.lang.Object
  extended by org.prorefactor.refactor.substitute.SubstituteRefactor
All Implemented Interfaces:
IConstants

public class SubstituteRefactor
extends java.lang.Object
implements IConstants

Given a handle to a PLUS node, where multiple PLUS and QSTRING nodes are used, changes the AST to use SUBSTITUTE, and synchronizes the scanner's token list.

Current implementation changes the AST, with no option to rollback the changes. (i.e. If the changes are rejected by the client, then the AST should be rebuilt (re-parse the compile unit) before using it for anything else.) See notes at top of SubstituteRefactor.java.


Field Summary
 
Fields inherited from interface org.prorefactor.core.IConstants
ABBREVIATED, CONTEXT_QUALIFIER, FALSE, FROM_USER_DICT, FULLTEXT, INLINE_VAR_DEF, NODE_TYPE_KEYWORD, OPERATOR, PROPARSEDIRECTIVE, QUALIFIED_CLASS_INT, QUALIFIED_CLASS_STRING, SOURCENUM, ST_DBTABLE, ST_TTABLE, ST_VAR, ST_WTABLE, STATE2, STATEHEAD, STORETYPE, TO_BE_CUT, TRUE, UNQUALIFIED_FIELD
 
Constructor Summary
SubstituteRefactor()
           
 
Method Summary
 int run(SubstituteTarget target, int scanNum)
          Run this refactor for a given handle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubstituteRefactor

public SubstituteRefactor()
Method Detail

run

public int run(SubstituteTarget target,
               int scanNum)
Run this refactor for a given handle.

Parameters:
target - The SubstituteTarget record which contains details about the node which needs refactoring.
Returns:
1 on success, or a negative number on fail: -1: Failed to synchronize, possibly due to preprocessing or escape sequences in source.


Copyright © 2008 Joanju Software. All Rights Reserved.