com.g11ntoolkit.xlclassname
Class XLClassName

java.lang.Object
  |
  +--com.g11ntoolkit.xlclassname.XLClassName

public class XLClassName
extends java.lang.Object

Find the class name in the specified file and replace it with the file name.

We assume that the class name must be the same as the file name. We also assume that the file name is correct for this class and that it already contains the language identifier.

You must specify the locale for the file if the encoding for the file is something other than ISO-8859-1.

Version:
2005/06/24
Author:
Bill Rich, Wilandra Consulting LLC
Copyright © 2001-2005, Wilandra Consulting LLC. All rights reserved.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See License Agreement.


Field Summary
private static java.util.logging.Logger log
          The log used for all messages from this class.
private static java.util.ResourceBundle mrb
          Messages used by tools and classes.
private static java.util.ResourceBundle vrb
          Constants and variables used by tools and classes.
 
Constructor Summary
XLClassName()
          Create an instance of the XLClassName tool.
 
Method Summary
static java.lang.StringBuffer fileBuf(java.lang.String inFileName, java.lang.String localeString)
          This method is used to load the input file into a buffer for processing.
static void main(java.lang.String[] args)
          Allows this tool to be run from the command line.
static java.lang.StringBuffer run(java.lang.String inFileName, java.lang.String localeString)
          Translates of the class name in the specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static java.util.logging.Logger log
The log used for all messages from this class.


mrb

private static java.util.ResourceBundle mrb
Messages used by tools and classes.


vrb

private static java.util.ResourceBundle vrb
Constants and variables used by tools and classes.

Constructor Detail

XLClassName

public XLClassName()
Create an instance of the XLClassName tool.

Method Detail

main

public static void main(java.lang.String[] args)
Allows this tool to be run from the command line.

Sets up the environment then calls the run method to do the work.

Parameters:
args - a String containing the command line parameters.

run

public static java.lang.StringBuffer run(java.lang.String inFileName,
                                         java.lang.String localeString)
                                  throws XLCNRunError
Translates of the class name in the specified file.

This method assumes that the file name is correct for the specified locale. It finds the class name in the source code and replaces it with the file name.

Parameters:
inFileName - a String containing the name of the input file.
localeString - a String containing the locale code string. This must be a valid locale code.
Returns:
a StringBuffer representing the contents of the input file with the class name translated
Throws:
XLCNRunError - for any error detected during the processing.

fileBuf

public static java.lang.StringBuffer fileBuf(java.lang.String inFileName,
                                             java.lang.String localeString)
                                      throws FileBufferError
This method is used to load the input file into a buffer for processing.

Parameters:
inFileName - a String containing the name of the input file.
localeString - a String containing the locale identifier. This must be a valid locale identifier.
Returns:
a StringBuffer representing the contents of the input file
Throws:
FileBufferError - for any I/O error in the input file.