All Packages  Class Hierarchy  This Package  Previous  Next  Index
  Class bradel.wordchanger.WordChanger
java.lang.Object
   |
   +----bradel.wordchanger.WordChanger
  -  public class WordChanger
  
-  extends Object
  
WordChanger reads in a set of java files
 and changes all of the method and variable
 names so as to make the files hard to read
 once they are compiled.
 This will not work with escape sequences,
 so A will not be translated to an 'a'.
 Values that will be replaced are all of the
 form: [a-zA-Z][0-9a-zA-z_]*
 so the Java behaviour of using dollar signs
 and whatever else is not considered.
 String constants will be ignored.
 Comments will be ignored.
 This program does not examine the java
 program structure to identify keywords
 which should not be changed.
 Words that are not to be changed
 are either java keywords or are specified
 in a set of files.
 Creation date: (30/12/2001 1:34:00 PM)
  -  Author:
  
 -  : Borys Bradel
 Copyright (c) 2001 Borys Bradel
 All rights reserved
 Command prompt:
 If no parameters, reads WordChanger.cfg as the default
 configuration file.
 Otherwise the first parameter has to be the name
 of the configuration file.
 Configuration file format:
 Each line has to be a tag word followed by one or
 more tokens (as specified by StringTokenizer. If
 a tag is omitted then what is in square brackets is
 assumed. The lines are as follows:
 {base_directory some_directory [default=""]}
 {package_directory some_directory [default=""]}
 {changed_file_directory some_directory [default="changed"]}
 {prefix some_prefix [default="bb"]}
 {exclude_from file1 file2 ... [default: none]}
 {not_scanned file1 file2 ... [default: none]}
 {debug boolean_value [default: false]}
 {conversion_data_file file_name [default=null]}
 {reverse_from file_name [default=null]}
 The directories are combined as follows to look for
 java source code files:
 base_directory + package_directory for input files and
 base_directory + changed_file_directory + 
 package_directory for output files.
 The java file names are just concatenated with these
 directory names, so they must have a / at the end
 (also, whether to use a / or a \ may be system specific).
 
  
  -  
	CFGBASEDIRTAG
   -  identifies a base directory
  
 -  
	CFGCHANGEDFILEDIRTAG
   -  identifies the changed file directory
  
 -  
	CFGDEBUGTAG
   -  identifies whether there should be debugging output
  
 -  
	CFGEXCLUDELISTFILETAG
   -  identifies the files that contain the words to exclude
  
 -  
	CFGNOTSCANNEDFILESTAG
   -  identifies the files that are not to be scanned
  
 -  
	CFGOUTPUTCONVERSIONDATATAG
   -  identifies where to store the conversion data, if any
  
 -  
	CFGPACKAGEDIRTAG
   -  identifies the package directory
  
 -  
	CFGPREFIXTAG
   -  identifies what prefix to use
  
 -  
	CFGREVERSECONVERSIONDATATAG
   -  forces a reverse conversion based on some file
  
 -  
	debug
   -  by default debug output is off
  
 -  
	DEFAULTCFGFILE
   -  default file name for the configeration file
  
 -  
	KEYWORDS
   -  java keywords, not to be changed
 
  
  -  
	WordChanger()
   -   WordChanger constructor does nothing
 
  
  -  
	createNewFiles(String[], String[], LineScanner)
   -   Read the file, save the new file to
 a string, and then overwrite the old
 file.
  
 -  
	createWordDataStorage(String[], LineScanner)
   -   Record what has to be changed in all
 of the files.
  
 -  
	main(String[])
   -   Starts the application.
 
  
KEYWORDS
 private static final String KEYWORDS[]
  -  java keywords, not to be changed
 
DEFAULTCFGFILE
 private static final String DEFAULTCFGFILE
  -  default file name for the configeration file
 
CFGBASEDIRTAG
 private static final String CFGBASEDIRTAG
  -  identifies a base directory
 
CFGPACKAGEDIRTAG
 private static final String CFGPACKAGEDIRTAG
  -  identifies the package directory
 
CFGCHANGEDFILEDIRTAG
 private static final String CFGCHANGEDFILEDIRTAG
  -  identifies the changed file directory
 
CFGEXCLUDELISTFILETAG
 private static final String CFGEXCLUDELISTFILETAG
  -  identifies the files that contain the words to exclude
 
CFGNOTSCANNEDFILESTAG
 private static final String CFGNOTSCANNEDFILESTAG
  -  identifies the files that are not to be scanned
 
CFGPREFIXTAG
 private static final String CFGPREFIXTAG
  -  identifies what prefix to use
 
CFGDEBUGTAG
 private static final String CFGDEBUGTAG
  -  identifies whether there should be debugging output
 
CFGOUTPUTCONVERSIONDATATAG
 private static final String CFGOUTPUTCONVERSIONDATATAG
  -  identifies where to store the conversion data, if any
 
CFGREVERSECONVERSIONDATATAG
 private static final String CFGREVERSECONVERSIONDATATAG
  -  forces a reverse conversion based on some file
 
debug
 private static boolean debug
  -  by default debug output is off
 
  
WordChanger
 public WordChanger()
  -  WordChanger constructor does nothing
 
  
createNewFiles
 public static void createNewFiles(String fileNameArray[],
                                   String fileNameOutArray[],
                                   LineScanner lineScanner)
  -  Read the file, save the new file to
 a string, and then overwrite the old
 file.
 Creation date: (30/12/2001 5:44:11 PM)
  
    -  Parameters:
    
 -  fileNameArray - java.lang.String[]
    
-  fileNameOutArray - java.lang.String[]
    
-  lineScanner - bradel.wordchanger.LineScanner
  
   
 
 
createWordDataStorage
 public static void createWordDataStorage(String fileNameArray[],
                                          LineScanner lineScanner)
  -  Record what has to be changed in all
 of the files.
 Creation date: (30/12/2001 5:38:12 PM)
  
    -  Parameters:
    
 -  fileNameArray - java.lang.String[]
    
-  lineScanner - bradel.wordchanger.LineScanner
  
  
 
 
main
 public static void main(String args[])
  -  Starts the application.
  
    -  Parameters:
    
 -  args - an array of command-line arguments
  
 
 
 
All Packages  Class Hierarchy  This Package  Previous  Next  Index