org.objectweb.jorm.compiler.lib
Class JormCompilerParameterImpl

java.lang.Object
  extended byorg.objectweb.jorm.compiler.lib.JormCompilerParameterImpl
All Implemented Interfaces:
java.lang.Cloneable, JormCompilerParameter, Loggable

public class JormCompilerParameterImpl
extends java.lang.Object
implements JormCompilerParameter

A JormCompilerParameter object is an object which manages informations read by the command line parser. These informations are needed to the compiler system to parse, generate, and compile.

Author:
X. Spengler

Field Summary
 
Fields inherited from interface org.objectweb.jorm.compiler.api.JormCompilerParameter
INHERITANCE_CLASSNAME_PATTERN, INHERITANCE_PACKAGE_PATTERN
 
Constructor Summary
JormCompilerParameterImpl()
           
 
Method Summary
 java.lang.Object clone()
           
 java.lang.String computePBindingInheritance(java.lang.String cn)
          Computes the actual class name which the generated PBinding class must extend.
 java.lang.String computePClassMappingInheritance(java.lang.String cn)
          Computes the actual class name which the generated PClassMapping class must extend.
 java.lang.String getBindingEnhancedClass()
           
 java.lang.String getBindingInheritance()
           
 java.lang.String getClassMappingInheritance()
           
 PathExplorer getClasspath()
           
 java.util.ArrayList getDtdLocations()
           
 java.util.Collection getInputFiles()
           
 java.lang.String getJavacName()
           
 Logger getLogger()
          Returns a logger to an component that wants to log things.
 LoggerFactory getLoggerFactory()
          Returns a logger factory that allows the creation of new loggers.
 java.lang.String getOutput()
           
 java.lang.String getProjectName()
           
 java.lang.String getStateInheritance()
           
 boolean isBindingAbstract()
           
 boolean isGenerateBinding()
           
 boolean isGeneratedPDFiles()
           
 boolean isGeneratedWithMapperPackage()
           
 boolean isJavac()
           
 boolean isKeepSrc()
           
 boolean isParseOnly()
           
 boolean isStateGenerated()
           
 boolean isVerbose()
           
 void loadConfFile(java.io.InputStream in, java.util.Iterator knownmappers)
          Load a jorm configuration file.
 void loadConfFile(java.lang.String file, java.util.Iterator knownmappers)
          Load a jorm configuration file.
 void print()
          Prints informations managed by the current object.
 void setBindingAbstract(boolean bindingAbstract)
           
 void setBindingEnhancedClass(java.lang.String bindingEnhancedClass)
           
 void setBindingInheritance(java.lang.String bindingInheritance)
           
 void setClassMappingInheritance(java.lang.String classMappingInheritance)
           
 void setClasspath(PathExplorer classpath)
           
 void setDtdLocations(java.util.ArrayList dtdLocations)
           
 void setGenerateBinding(boolean v)
           
 void setGeneratedPDFiles(boolean generatedPDFiles)
           
 void setGeneratedWithMapperPackage(boolean generatedWithMapperPackage)
           
 void setInputFiles(java.util.Collection inputFiles)
           
 void setJavac(boolean javac)
           
 void setKeepSrc(boolean keepSrc)
           
 void setLogConfFile(java.lang.String logConfFile)
           
 void setLogger(Logger logger)
          Assigns a logger to an component that wants to log things.
 void setLoggerFactory(LoggerFactory lf)
          Assigns a logger factory that allows the creation of new loggers.
 void setOutput(java.lang.String output)
           
 void setProjectName(java.lang.String projectName)
           
 void setStateGenerated(boolean v)
           
 void setStateInheritance(java.lang.String stateInheritance)
           
 void setVerbose(boolean verbose)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JormCompilerParameterImpl

public JormCompilerParameterImpl()
Method Detail

print

public void print()
Prints informations managed by the current object.

Specified by:
print in interface JormCompilerParameter

computePClassMappingInheritance

public java.lang.String computePClassMappingInheritance(java.lang.String cn)
Computes the actual class name which the generated PClassMapping class must extend.

Specified by:
computePClassMappingInheritance in interface JormCompilerParameter
Parameters:
cn - The class name of the persistent class for which the code is generated.
Returns:
The computed class name.

computePBindingInheritance

public java.lang.String computePBindingInheritance(java.lang.String cn)
Computes the actual class name which the generated PBinding class must extend.

Specified by:
computePBindingInheritance in interface JormCompilerParameter
Parameters:
cn - The class name of the persistent class for which the code is generated.
Returns:
The computed class name.

loadConfFile

public void loadConfFile(java.lang.String file,
                         java.util.Iterator knownmappers)
                  throws PException
Load a jorm configuration file.

Specified by:
loadConfFile in interface JormCompilerParameter
Parameters:
file - the name of the jorm configuration file
Throws:
PException

loadConfFile

public void loadConfFile(java.io.InputStream in,
                         java.util.Iterator knownmappers)
                  throws PException
Load a jorm configuration file.

Specified by:
loadConfFile in interface JormCompilerParameter
Parameters:
in - the input stream of the jorm configuration file
Throws:
PException

getClasspath

public PathExplorer getClasspath()
Specified by:
getClasspath in interface JormCompilerParameter

getOutput

public java.lang.String getOutput()
Specified by:
getOutput in interface JormCompilerParameter
Returns:
the output directory where the generated will be put

isVerbose

public boolean isVerbose()
Specified by:
isVerbose in interface JormCompilerParameter
Returns:
a boolean value indicating if the verbose mode is activated

getInputFiles

public java.util.Collection getInputFiles()
Specified by:
getInputFiles in interface JormCompilerParameter

isKeepSrc

public boolean isKeepSrc()
Specified by:
isKeepSrc in interface JormCompilerParameter

getJavacName

public java.lang.String getJavacName()
Specified by:
getJavacName in interface JormCompilerParameter

getProjectName

public java.lang.String getProjectName()
Specified by:
getProjectName in interface JormCompilerParameter

isJavac

public boolean isJavac()
Specified by:
isJavac in interface JormCompilerParameter

isParseOnly

public boolean isParseOnly()
Specified by:
isParseOnly in interface JormCompilerParameter

isGenerateBinding

public boolean isGenerateBinding()
Specified by:
isGenerateBinding in interface JormCompilerParameter

setGenerateBinding

public void setGenerateBinding(boolean v)
Specified by:
setGenerateBinding in interface JormCompilerParameter

isStateGenerated

public boolean isStateGenerated()
Specified by:
isStateGenerated in interface JormCompilerParameter

setStateGenerated

public void setStateGenerated(boolean v)
Specified by:
setStateGenerated in interface JormCompilerParameter

getStateInheritance

public java.lang.String getStateInheritance()
Specified by:
getStateInheritance in interface JormCompilerParameter
Returns:
the name of the class extended by the generated XXXState classes

getBindingInheritance

public java.lang.String getBindingInheritance()
Specified by:
getBindingInheritance in interface JormCompilerParameter
Returns:
the name of the class inherited by the generated XXXBinding

getBindingEnhancedClass

public java.lang.String getBindingEnhancedClass()
Specified by:
getBindingEnhancedClass in interface JormCompilerParameter

getClassMappingInheritance

public java.lang.String getClassMappingInheritance()
Specified by:
getClassMappingInheritance in interface JormCompilerParameter

isBindingAbstract

public boolean isBindingAbstract()
Specified by:
isBindingAbstract in interface JormCompilerParameter

getDtdLocations

public java.util.ArrayList getDtdLocations()
Specified by:
getDtdLocations in interface JormCompilerParameter

isGeneratedPDFiles

public boolean isGeneratedPDFiles()
Specified by:
isGeneratedPDFiles in interface JormCompilerParameter

isGeneratedWithMapperPackage

public boolean isGeneratedWithMapperPackage()
Specified by:
isGeneratedWithMapperPackage in interface JormCompilerParameter

setLogger

public void setLogger(Logger logger)
Description copied from interface: Loggable
Assigns a logger to an component that wants to log things.

Specified by:
setLogger in interface Loggable
Parameters:
logger - the logger object

setLoggerFactory

public void setLoggerFactory(LoggerFactory lf)
Description copied from interface: Loggable
Assigns a logger factory that allows the creation of new loggers.

Specified by:
setLoggerFactory in interface Loggable
Parameters:
lf - the LoggerFactory object to obtain new loggers

getLogger

public Logger getLogger()
Description copied from interface: Loggable
Returns a logger to an component that wants to log things.

Specified by:
getLogger in interface Loggable

getLoggerFactory

public LoggerFactory getLoggerFactory()
Description copied from interface: Loggable
Returns a logger factory that allows the creation of new loggers.

Specified by:
getLoggerFactory in interface Loggable

clone

public java.lang.Object clone()
Specified by:
clone in interface JormCompilerParameter

setClasspath

public void setClasspath(PathExplorer classpath)
Specified by:
setClasspath in interface JormCompilerParameter

setOutput

public void setOutput(java.lang.String output)
Specified by:
setOutput in interface JormCompilerParameter

setVerbose

public void setVerbose(boolean verbose)
Specified by:
setVerbose in interface JormCompilerParameter

setKeepSrc

public void setKeepSrc(boolean keepSrc)
Specified by:
setKeepSrc in interface JormCompilerParameter

setProjectName

public void setProjectName(java.lang.String projectName)
Specified by:
setProjectName in interface JormCompilerParameter

setJavac

public void setJavac(boolean javac)
Specified by:
setJavac in interface JormCompilerParameter

setStateInheritance

public void setStateInheritance(java.lang.String stateInheritance)
Specified by:
setStateInheritance in interface JormCompilerParameter

setBindingInheritance

public void setBindingInheritance(java.lang.String bindingInheritance)
Specified by:
setBindingInheritance in interface JormCompilerParameter

setBindingEnhancedClass

public void setBindingEnhancedClass(java.lang.String bindingEnhancedClass)
Specified by:
setBindingEnhancedClass in interface JormCompilerParameter

setClassMappingInheritance

public void setClassMappingInheritance(java.lang.String classMappingInheritance)
Specified by:
setClassMappingInheritance in interface JormCompilerParameter

setBindingAbstract

public void setBindingAbstract(boolean bindingAbstract)
Specified by:
setBindingAbstract in interface JormCompilerParameter

setDtdLocations

public void setDtdLocations(java.util.ArrayList dtdLocations)
Specified by:
setDtdLocations in interface JormCompilerParameter

setGeneratedPDFiles

public void setGeneratedPDFiles(boolean generatedPDFiles)
Specified by:
setGeneratedPDFiles in interface JormCompilerParameter

setInputFiles

public void setInputFiles(java.util.Collection inputFiles)
Specified by:
setInputFiles in interface JormCompilerParameter

setGeneratedWithMapperPackage

public void setGeneratedWithMapperPackage(boolean generatedWithMapperPackage)
Specified by:
setGeneratedWithMapperPackage in interface JormCompilerParameter

setLogConfFile

public void setLogConfFile(java.lang.String logConfFile)
Specified by:
setLogConfFile in interface JormCompilerParameter