org.objectweb.jorm.comp.cmdline.lib
Class CommandLineParser

java.lang.Object
  |
  +--org.objectweb.jorm.comp.cmdline.lib.CommandLineParser
All Implemented Interfaces:
Loggable

public class CommandLineParser
extends java.lang.Object
implements Loggable

The CommandLineParser object parses the command line of the compiler to build a compilation context object. This object will be used to parse xml files, to generate java source files and to compile java files into class files.

Author:
X. Spengler

Constructor Summary
CommandLineParser()
          default constructor
CommandLineParser(BasicClassLoader cl, CompilerParameter cp)
          Builds a new CommandLineParser object.
 
Method Summary
 CompilerParameter getCompilerParameter()
          Returns the current compilation context object.
 org.objectweb.util.monolog.api.Logger getLogger()
          Returns a logger to an component that wants to log things.
 org.objectweb.util.monolog.api.LoggerFactory getLoggerFactory()
          Returns a logger factory that allows the creation of new loggers.
 void parse(java.lang.String[] args, java.util.Hashtable exts)
          Parses all the arguments of the command line.
static void printVersion()
          Prints the version number of the compiler.
 void setLogger(org.objectweb.util.monolog.api.Logger logger)
          Defines a logger object.
 void setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory loggerFactory)
          Defines the logger factory to obtain new logger.
static void usage()
          Prints to the console the usage (how to use and options) of the compiler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandLineParser

public CommandLineParser(BasicClassLoader cl,
                         CompilerParameter cp)
Builds a new CommandLineParser object. This constructor initializes the compilationcontext to fill in.
Parameters:
cl - the classloader to use to load classes

CommandLineParser

public CommandLineParser()
default constructor
Method Detail

printVersion

public static void printVersion()
Prints the version number of the compiler.

usage

public static void usage()
Prints to the console the usage (how to use and options) of the compiler.

getCompilerParameter

public CompilerParameter getCompilerParameter()
Returns the current compilation context object.
Returns:
the current CompilerParameter

parse

public void parse(java.lang.String[] args,
                  java.util.Hashtable exts)
Parses all the arguments of the command line.
Parameters:
args - the arguments of the command line

setLogger

public void setLogger(org.objectweb.util.monolog.api.Logger logger)
Defines a logger object.
Specified by:
setLogger in interface Loggable
Parameters:
logger - the logger object

setLoggerFactory

public void setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory loggerFactory)
Defines the logger factory to obtain new logger.
Specified by:
setLoggerFactory in interface Loggable
Parameters:
loggerFactory - the LoggerFactory object to obtain a logger object

getLogger

public org.objectweb.util.monolog.api.Logger getLogger()
Description copied from interface: Loggable
Returns a logger to an component that wants to log things.
Specified by:
getLogger in interface Loggable
Following copied from interface: org.objectweb.jorm.util.api.Loggable
Parameters:
logger - the logger object

getLoggerFactory

public org.objectweb.util.monolog.api.LoggerFactory getLoggerFactory()
Description copied from interface: Loggable
Returns a logger factory that allows the creation of new loggers.
Specified by:
getLoggerFactory in interface Loggable
Following copied from interface: org.objectweb.jorm.util.api.Loggable
Parameters:
loggerfactory - the LoggerFactory object to obtain new loggers