synergy.debug
Class Strip

java.lang.Object
  |
  +--synergy.debug.Strip

public class Strip
extends java.lang.Object

The strip application will act as a pre-processor to the compiler, it will run through the source files in the specified directory and (if requested) recursively comment out or uncomment the debug information in the code.

This class also supports specific additional tags the developer can include in the source code to designate a block of code, spanning multiple lines, as a debug block which can be toggled on and off (commented) at the users whim.

Usage

When run from the command line, it should be supplied with the starting directory to recurse through as well as a flag indicating whether to strip or revive the debugging information.

To specify the directory, use the -d directoryname option

To specify the type of run (strip or revive) use -s to strip and -r to revive

When using the debug classes in the code, you can comment out lines of code within the debug block or just a debug or log class reference itself. When the Strip application runs over this, it will not prepend another set of comments on the line so that when you go to strip these comments out you only need to run over it once and your original comments remain.

It should be noted that if you run the Strip in revive mode over a class that has not been stripped, any debug information that has been commented out by the coder may be revived as well.

To ensure that this doesn't happen, coder inserted comments should be placed next to the statement to comment out rather than against the left hand margin.

 eg.
 //          Debug.doFatalError("Just kidding");         ill-advised
             //Debug.doFatalError("Just kidding");       recommended
 


Constructor Summary
Strip()
           
 
Method Summary
 void doDirRecurse(java.io.File file)
          When this method is called, it runs through the source files recurisvely from the directory the program was started in and comments out all the debug information.
 void doProcessing(java.io.File file)
          This method will comment out all the debuggin info from the given file.
static void main(java.lang.String[] args)
          When the Strip application is run, this method is called.
 void setStrip(boolean strip)
          Sets the functionality of the application to either stripping or reviving
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Strip

public Strip()
Method Detail

main

public static void main(java.lang.String[] args)
When the Strip application is run, this method is called. Any arguments given on the command line, or as paramaters to the program in any way, will be supplied in the String array. The paramaters required are defined by the program as it is run.
Parameters:
args - The command line arguments

setStrip

public void setStrip(boolean strip)
Sets the functionality of the application to either stripping or reviving
Parameters:
strip - The new value of strip, true for stripping, false for reviving

doDirRecurse

public void doDirRecurse(java.io.File file)
When this method is called, it runs through the source files recurisvely from the directory the program was started in and comments out all the debug information.

doProcessing

public void doProcessing(java.io.File file)
This method will comment out all the debuggin info from the given file.
Parameters:
file - The file to strip