org.javagen.revgen
Class Main
java.lang.Object
org.javagen.agile.core.ioc.spring.SpringMain
org.javagen.revgen.Main
public class Main
- extends org.javagen.agile.core.ioc.spring.SpringMain
Loads RevGen configuration and executes code generation pipeline using Spring framework IoC BeanFactory.
This class excepts two arguments: revgen.properties and RevGenSpringConfig.xml.
revgen.properties is meant to be the first (ie easiest) level of RevGen configuration specifying:
- Database connection properties
- Generated project name and directory location
- Source folder layout
- Output types: annotations vs XML, Hibernate vs Spring vs EJB3 implementations, etc.
- The global overwrite policy (aka
overwriteAll)
Any type of configuration can be achieved using RevGenSpringConfig.xml including:
- Pipeline components and order of execution
- Template names, locations and types and their artifact naming patterns and relative output locations
- Per-template overwrite predicates
- Binding templates to model instances
- Root structure of model tree including global properties and parent containers for generated model instances
- Default and artifact-specific naming patterns using model and emitter contexts
- Reading, writing and merging of metadata
- Database table selection
- Code naming and conversion implementations
- Anything that
revgen.properties can specify
Properties inputs have the following precedence from lowest to highest:
- Properties specified in the
GlobalPropertyHolder bean within the RevGenSpringConfig.xml file.
- Properties specified in the external
propertyFile. Note: this can be specified as a GlobalPropertyHolder property and overridden here.
- Properties specified in the
properties instance. Note: these are usually set by the invoking tool (i.e. Maven).
This is an extremely flexible way to configure the code generator, avoiding a one-size-fits-all approach.
- Author:
- Richard Easterling
| Fields inherited from class org.javagen.agile.core.ioc.spring.SpringMain |
beanFactory, configFile, DEFAULT_CONFIG_FILE, DEFAULT_CONFIGURER_BEAN_ID, DEFAULT_PIPELINE_BEAN_ID, DEFAULT_ROOT_BEAN_NAME_ID, DEFAULT_TEMPLATE_GENERATOR_BEAN_ID, properties, propertyFile, startModelBeanId |
|
Constructor Summary |
Main()
|
|
Method Summary |
static void |
main(String[] args)
Loads and runs RevGen using Spring configuration file. |
| Methods inherited from class org.javagen.agile.core.ioc.spring.SpringMain |
getBean, getBeanFactory, getConfigFile, getConfigurerBeanId, getPipelineBeanId, getStartModelBeanId, runPipeline, setArgs, setConfigFile, setProperties, setPropertyFile, setStartModelBeanId |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Main
public Main()
main
public static void main(String[] args)
throws Exception
- Loads and runs RevGen using Spring configuration file. RevGen is started by invoking
the
pipeline bean.
- Parameters:
args - takes an optional Spring XML configuration file location and/or a properties file.
Files can be any valid URL or classpath location. File types are recognized by their extension,
names and order are not important. Here are some valid examples:
- file:src/revgen/RevGenSpringConfig.xml
- classpath:RevGenSpringConfig.xml
- file:src/revgen/revgen.properties
- classpath:revgen.properties
- Throws:
Exception
Copyright 2006-2006-2007 Outsource Cafe Inc.. All Rights Reserved.