org.objectweb.jorm.comp.compiler.api
Interface CompilerParameter

All Superinterfaces:
org.objectweb.jorm.util.api.Loggable

public interface CompilerParameter
extends org.objectweb.jorm.util.api.Loggable

The CompilerParameter interface defines methods to set an get 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
static java.lang.String INHERITANCECNPATTERN
          The pattern that represents the JORM class name to be replaced into the string defining the inherited class of a either the PBinding or the PClassMapping that is generated.
 
Method Summary
 void addCPExtension(java.lang.String name, java.lang.Object ext)
          Allows to add into the hashtable object, the CommandLineParser extension objects which is identified by the @parameter name.
 boolean addInputFileName(java.lang.String fileName)
          Adds a file name to the list of the input file names.
 void clearInputFileNames()
           
 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.
 org.objectweb.util.io.api.PathExplorer getClasspath()
          Returns the classpath used to search files or to compile.
 java.util.Hashtable getCPExtension()
          Allows to get the hashtable object which contains the CommandLineParser extension objects.
 java.lang.Object getCPExtension(java.lang.String name)
          Returns an object, in most cases, it should be a com.mypackage.myobjects.CmdLineParser object.
 java.util.ArrayList getDtdLocations()
          Returns the list of DTD locations that are specified.
 java.util.Collection getInputFileNames()
          Allows to get a list of input file names (.pd files).
 java.lang.String getJavaCompiler()
          Returns the java compiler sets by the programmer on the command line.
 java.lang.String getMapperName()
          Returns the mapper name specified by the user.
 java.lang.String getMappingFactory()
          Returns the name of the mapping factory used by the meta information to build mapping information.
 java.lang.String getMappingName()
          Returns the name of the mapping specified by the user.
 Manager getMetaInfoManager()
           
 java.lang.String getMetaInfoName()
          Returns the class name of the meta information system.
 java.lang.String getOutputDirectory()
          Returns the directory where files must be generated.
 java.lang.String getParserName()
          Returns the class of the xml parser specified by the user.
 java.lang.String getPBindingInheritance()
          Returns the class name which the generated PBinding class must extend.
 java.lang.String getPClassMappingInheritance()
          Returns the class name which the generated PClassMapping classes must be extended.
 java.lang.String getVerifierName()
          Returns the name of the class which makes the verification of the specific part of the meta-information.
 boolean isBindingAbstract()
          Allows to know if the Binding object is abstract or not.
 boolean isDtdVerify()
          Allows to know if the dtd is used or not to validate the xml files.
 boolean isGenDep()
          Allows to know if the dependances must be generated or not.
 boolean isKeepSrc()
          Allows to know if the programmer wants to keep the sources files or not.
 boolean isNoBuild()
          Returns true if the user doesn't want to generate files.
 boolean isNoCompile()
          Returns true if the user doesn't want that the generated files must be compiled.
 boolean isVerbose()
          Allows to know if the user want to know verbose informations.
 boolean isVerifyContext()
          Verifies environment context before the parsing must be launched.
 boolean isVerifyMetaInfo()
          Returns if the user wants or not the verification of the meta information.
 void loadConfFile(java.lang.String file)
          Loads a jorm configuration file.
 void print()
          Prints informations managed by the current object.
 void setBindingAbstract(boolean bindingAbstract)
          Defines if the Binding object is defined abstract or not.
 void setClasspath(org.objectweb.util.io.api.PathExplorer path)
          Defines the classpath for the current jorm compilation.
 void setDtdLocations(java.util.ArrayList al)
          Assigns the list of DTD locations that are specified.
 void setDtdVerify(boolean verif)
          Allows to set if the dtd must be used or not to validate the xml files.
 void setGenDep(boolean gendep)
          Enables or disables the generation of the dependances.
 void setJavaCompiler(java.lang.String jc)
          Sets the java compiler used to compile files when the generation process will be finished.
 void setKeepSrc(boolean keepSrc)
          Sets the keep source flag.
 void setLogConfFile(java.lang.String filename)
          It initializes the logging system with the specified logging configuration file.
 void setMapperName(java.lang.String mapperName)
          Defines the name of the mapper.
 void setMappingFactory(java.lang.String mappingFactory)
          Defines the name of the mapping factory used by the meta information to build mapping information.
 void setMappingName(java.lang.String mappingName)
          Defines the name of the mapping
 void setMetaInfoManager(Manager mngr)
          Sets the class name of the meta information system.
 void setMetaInfoName(java.lang.String metainfo)
          Sets the class name of the meta information system.
 void setNoBuild(boolean nobuild)
          Sets if the user does not want to generate files.
 void setNoCompile(boolean noCompile)
          Sets if the user does not want to compile generated files.
 void setOutputDirectory(java.lang.String directory)
          Defines the output directory for the generation of the java files.
 void setParserName(java.lang.String parser_)
          Defines the name of the parser class which is able to parse the meta information related to a given mapping.
 void setPBindingInheritance(java.lang.String classname)
          Sets the generated PBinding class name.
 void setPClassMappingInheritance(java.lang.String v)
          Sets the name of the generated PBinder class name.
 void setVerbose(boolean mode)
          Sets the verbose mode.
 void setVerifierName(java.lang.String verifier)
          Sets the name of the class which makes the verification of the specific part of the meta-information.
 void setVerifyContext(boolean verifyContext)
          Defines if the environment context must be verified before the parsing must be launched.
 void setVerifyMetaInfo(boolean verify)
          Sets if the user wants or not the verification of the meta information.
 
Methods inherited from interface org.objectweb.jorm.util.api.Loggable
getLogger, getLoggerFactory, setLogger, setLoggerFactory
 

Field Detail

INHERITANCECNPATTERN

public static final java.lang.String INHERITANCECNPATTERN
The pattern that represents the JORM class name to be replaced into the string defining the inherited class of a either the PBinding or the PClassMapping that is generated.
Method Detail

getDtdLocations

public java.util.ArrayList getDtdLocations()
Returns the list of DTD locations that are specified.

setDtdLocations

public void setDtdLocations(java.util.ArrayList al)
Assigns the list of DTD locations that are specified.

getOutputDirectory

public java.lang.String getOutputDirectory()
Returns the directory where files must be generated.
Returns:
null if the directory is not specified or a path with system separator

setOutputDirectory

public void setOutputDirectory(java.lang.String directory)
Defines the output directory for the generation of the java files.
Parameters:
directory - the name of the output directory

getPClassMappingInheritance

public java.lang.String getPClassMappingInheritance()
Returns the class name which the generated PClassMapping classes must be extended.
Returns:
null if the generated PClassMapping classes do not inherit of any class or the full class name (with package name) using dot as package separator.

computePClassMappingInheritance

public java.lang.String computePClassMappingInheritance(java.lang.String cn)
Computes the actual class name which the generated PClassMapping class must extend.
Parameters:
cn - The class name of the persistent class for which the code is generated.
Returns:
The computed class name.

getPBindingInheritance

public java.lang.String getPBindingInheritance()
Returns the class name which the generated PBinding class must extend.
Returns:
null if the generated PBinding classes do not inherit of any class or the full class name (with package name) using dot as package separator.

computePBindingInheritance

public java.lang.String computePBindingInheritance(java.lang.String cn)
Computes the actual class name which the generated PBinding class must extend.
Parameters:
cn - The class name of the persistent class for which the code is generated.
Returns:
The computed class name.

setPClassMappingInheritance

public void setPClassMappingInheritance(java.lang.String v)
Sets the name of the generated PBinder class name.
Parameters:
v - the class name which must be extended by the generated PBinder. If the parameter is null, then the generated PBinder does not inherit any class.

setPBindingInheritance

public void setPBindingInheritance(java.lang.String classname)
Sets the generated PBinding class name.
Parameters:
classname - the class name which must be extended by the generated PBinding. If the parameter is null, then the generated PBinding does not inherit any class.

isNoCompile

public boolean isNoCompile()
Returns true if the user doesn't want that the generated files must be compiled.
Returns:
true, if the user does not want that the generated files must be compiled, else false

isNoBuild

public boolean isNoBuild()
Returns true if the user doesn't want to generate files.
Returns:
true, if the user does not want to generate files

getParserName

public java.lang.String getParserName()
Returns the class of the xml parser specified by the user.
Returns:
the string representation of the parser class name

getMapperName

public java.lang.String getMapperName()
Returns the mapper name specified by the user.
Returns:
the name of the mapper

getMappingName

public java.lang.String getMappingName()
Returns the name of the mapping specified by the user.
Returns:
the name of the mapping

setKeepSrc

public void setKeepSrc(boolean keepSrc)
Sets the keep source flag.
Parameters:
keepSrc - true, the sources will not be destroyed, else false, the sources will be removed

isKeepSrc

public boolean isKeepSrc()
Allows to know if the programmer wants to keep the sources files or not.
Returns:
true, the source files are not removed, else false, the source files are removed

setJavaCompiler

public void setJavaCompiler(java.lang.String jc)
Sets the java compiler used to compile files when the generation process will be finished.
Parameters:
jc - the Java compiler

getJavaCompiler

public java.lang.String getJavaCompiler()
Returns the java compiler sets by the programmer on the command line.
Returns:
the string representation of the java compiler name

setVerbose

public void setVerbose(boolean mode)
Sets the verbose mode.
Parameters:
mode - true, verbose informations will be furnished, else false, no informations are sent to the programmer

isVerbose

public boolean isVerbose()
Allows to know if the user want to know verbose informations.
Returns:
true, the verbose informations will be furnished, else false, no informations are sent to the programmer

addInputFileName

public boolean addInputFileName(java.lang.String fileName)
Adds a file name to the list of the input file names.
Parameters:
fileName - the name of the file to add to the list
Returns:
true, if the file is added to the list (was not yet present), else false, if the file is already in the list (and has not been added)

clearInputFileNames

public void clearInputFileNames()

getInputFileNames

public java.util.Collection getInputFileNames()
Allows to get a list of input file names (.pd files).
Returns:
an iterator over the input file names (iterator of String)

print

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

setClasspath

public void setClasspath(org.objectweb.util.io.api.PathExplorer path)
Defines the classpath for the current jorm compilation.
Parameters:
classpath - the string representation of the classpath

getClasspath

public org.objectweb.util.io.api.PathExplorer getClasspath()
Returns the classpath used to search files or to compile.
Returns:
the string representation of the classpath

setMapperName

public void setMapperName(java.lang.String mapperName)
Defines the name of the mapper.
Parameters:
mapperName - the name of the mapper

setMappingName

public void setMappingName(java.lang.String mappingName)
Defines the name of the mapping
Parameters:
mappingName - the name of the mapping

setMappingFactory

public void setMappingFactory(java.lang.String mappingFactory)
Defines the name of the mapping factory used by the meta information to build mapping information.
Parameters:
mappingFactory - the name of the mapping factory class

getMappingFactory

public java.lang.String getMappingFactory()
Returns the name of the mapping factory used by the meta information to build mapping information.
Returns:
the name of the mapping factory class

setParserName

public void setParserName(java.lang.String parser_)
Defines the name of the parser class which is able to parse the meta information related to a given mapping.
Parameters:
parser_ - the name of the parser

setNoCompile

public void setNoCompile(boolean noCompile)
Sets if the user does not want to compile generated files.
Parameters:
noCompile - true, no files are compiled, else false

setNoBuild

public void setNoBuild(boolean nobuild)
Sets if the user does not want to generate files.
Parameters:
noBuild - true, no files are generated, else false

loadConfFile

public void loadConfFile(java.lang.String file)
                  throws PException
Loads a jorm configuration file.
Parameters:
file - the name of the jorm configuration file
Returns:
true, if everything is ok, else false

setVerifyMetaInfo

public void setVerifyMetaInfo(boolean verify)
Sets if the user wants or not the verification of the meta information.
Parameters:
verify - if true, the global check is made, else false

isVerifyMetaInfo

public boolean isVerifyMetaInfo()
Returns if the user wants or not the verification of the meta information.
Returns:
true, the user want the verification of the meta information, else false

setVerifierName

public void setVerifierName(java.lang.String verifier)
Sets the name of the class which makes the verification of the specific part of the meta-information.
Parameters:
verifier - the name of the class verifier

getVerifierName

public java.lang.String getVerifierName()
Returns the name of the class which makes the verification of the specific part of the meta-information.
Returns:
the name of the class verifier

getCPExtension

public java.lang.Object getCPExtension(java.lang.String name)
Returns an object, in most cases, it should be a com.mypackage.myobjects.CmdLineParser object. This object is created by the CommandLineParser to parse specific option on the command line. The returned object is composed by a list of getter, to obtain object values.

example: if a -myoption is parsed by the a MyCmdLineParser object wich is an implementation of CmdLineParser. This object is returned by the getCPExtension method when it calls with "MyCmdLineParser" as argument.

Parameters:
name - the name of the class with makes the extension of the command line

addCPExtension

public void addCPExtension(java.lang.String name,
                           java.lang.Object ext)
Allows to add into the hashtable object, the CommandLineParser extension objects which is identified by the @parameter name.

getCPExtension

public java.util.Hashtable getCPExtension()
Allows to get the hashtable object which contains the CommandLineParser extension objects. The key of the hashtable is the name of the extension class, and the value, the Class itself.
Parameters:
exts_ - the Hashtable object which contains the CommandLineParser extension

setMetaInfoName

public void setMetaInfoName(java.lang.String metainfo)
Sets the class name of the meta information system. The Class must be an implementation of the Manager api.
Parameters:
metainfo - the class name of the meta information manager implementation

setMetaInfoManager

public void setMetaInfoManager(Manager mngr)
Sets the class name of the meta information system. The Class must be an implementation of the Manager api.
Parameters:
metainfo - the class name of the meta information manager implementation

getMetaInfoName

public java.lang.String getMetaInfoName()
Returns the class name of the meta information system. The Class is an implementation of the Manager api.
Returns:
the String representation of the meta information manager implementation

getMetaInfoManager

public Manager getMetaInfoManager()

setDtdVerify

public void setDtdVerify(boolean verif)
Allows to set if the dtd must be used or not to validate the xml files.
Parameters:
verif - if true, the dtd is used to verify the xml files, else false

isDtdVerify

public boolean isDtdVerify()
Allows to know if the dtd is used or not to validate the xml files.
Returns:
true, if the dtd must be used to validate xml files,

false, if the dtd is not used.


setGenDep

public void setGenDep(boolean gendep)
Enables or disables the generation of the dependances.
Parameters:
gendep - true, the dependances are generated, else false

isGenDep

public boolean isGenDep()
Allows to know if the dependances must be generated or not.
Returns:
true, if the dependances are generated, else false

setBindingAbstract

public void setBindingAbstract(boolean bindingAbstract)
Defines if the Binding object is defined abstract or not.
Parameters:
bindingAbstract - true, the Binding object is abstract, else false

isBindingAbstract

public boolean isBindingAbstract()
Allows to know if the Binding object is abstract or not.
Returns:
true, the Binding object is abstract, else false

isVerifyContext

public boolean isVerifyContext()
Verifies environment context before the parsing must be launched.
Returns:
true, if the context must be checked before using the parser, else false

setVerifyContext

public void setVerifyContext(boolean verifyContext)
Defines if the environment context must be verified before the parsing must be launched.
Parameters:
verifyContext - if true, the context will be checked before to use the parser, else false

setLogConfFile

public void setLogConfFile(java.lang.String filename)
                    throws PException
It initializes the logging system with the specified logging configuration file.
Parameters:
filename - is the file name of the configuration file.