RbUtils 0.13

org.ktc.rbutils.rb.generation
Class RbGeneratorUtility

java.lang.Object
  extended by org.ktc.rbutils.rb.AbstractUtility
      extended by org.ktc.rbutils.rb.generation.RbGeneratorUtility
All Implemented Interfaces:
GeneratorUtility, Utility

public class RbGeneratorUtility
extends AbstractUtility
implements GeneratorUtility

Command line utility for ResourceBundle generation.

Since:
RbUtils 0.8.1
Version:
$Revision: 1.7 $
Author:
ktcguru

Field Summary
static String ERROR_MSG_GEN_NBR
          Error mesage when more than on target generation directory is specified.
protected static String OPTION_GEN
          The g option (for target generation directory).
 
Fields inherited from class org.ktc.rbutils.rb.AbstractUtility
cmdLine, ERROR_MSG_EXTENSION_NBR, ERROR_MSG_ROOT_NBR, internalArgs, MSG_MISSING_REQUIRED_OPTION, OPTION_EXTENSION, OPTION_FILE, OPTION_LOG, OPTION_ROOT, options, REQUIRED_HEADER, root, SEP_LOG_OPTION, taskName
 
Constructor Summary
protected RbGeneratorUtility(String[] args)
          Creates a new instance of RbGeneratorUtility.
 
Method Summary
 File getGenDir()
          Parses the arguments of this utility in order to get the generation target directory to be used by this utility.
protected static int mainNoExit(String[] args, PrintWriter pw)
          Launches the utility.
protected  int process()
          Launches the utility.
 
Methods inherited from class org.ktc.rbutils.rb.AbstractUtility
clone, getCommonOptions, getExtension, getFilesToBeProcessed, getLoggers, getRootDir, getUniqueDir, getUniqueOptionValue, parse, parseParameters, usage, usage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ktc.rbutils.rb.Utility
getExtension, getFilesToBeProcessed, getLoggers, getRootDir, parse, parseParameters, usage, usage
 

Field Detail

OPTION_GEN

protected static final String OPTION_GEN
The g option (for target generation directory).

See Also:
Constant Field Values

ERROR_MSG_GEN_NBR

public static final String ERROR_MSG_GEN_NBR
Error mesage when more than on target generation directory is specified.

See Also:
Constant Field Values
Constructor Detail

RbGeneratorUtility

protected RbGeneratorUtility(String[] args)
Creates a new instance of RbGeneratorUtility.

Parameters:
args - the arguments to be passed to the utility.
Method Detail

getGenDir

public File getGenDir()
               throws RbUtilsException,
                      FileNotFoundException
Parses the arguments of this utility in order to get the generation target directory to be used by this utility.

The Utility.parseParameters() method MUST have been previously called.

Specified by:
getGenDir in interface GeneratorUtility
Returns:
the directory where files will be generated.
Throws:
RbUtilsException - if more than one -g option is specified.
FileNotFoundException - if the -g option specified a directory that does not exist in the file system.

process

protected int process()
               throws Exception
Launches the utility. Do not display anything. Call method should catch parse exceptions and display messages to user.

Returns:
the number of errors that occur during the generation (this does not count arguments parse error).
Throws:
Exception - the arguments to be passed to the utility.

mainNoExit

protected static int mainNoExit(String[] args,
                                PrintWriter pw)
Launches the utility. Acts like the main method but does not exit.

Parameters:
args - the arguments to be passed to the utility.
pw - the Writer to be used to print messages.
Returns:
the number of error detected during generation.

Back to the RbUtils Home Page

Copyright © 2005-2009 RbUtils Project. All Rights Reserved.