Package org.joda.beans.gen
Class BeanCodeGen
- java.lang.Object
-
- org.joda.beans.gen.BeanCodeGen
-
public class BeanCodeGen extends Object
Code generator for the beans.This reads in a
.java
file, parses it, and writes out an updated version.
-
-
Constructor Summary
Constructors Constructor Description BeanCodeGen(List<File> files, BeanGenConfig config, int verbosity, boolean write)
Creates the generator for a single bean.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BeanCodeGen
createFromArgs(String[] args)
Creates an instance ofBeanCodeGen
from arguments.static void
main(String[] args)
Main method.int
process()
Processes the file, recursing as necessary, generating the source code.List<File>
processFiles()
Processes the file, recursing as necessary, generating the source code.
-
-
-
Constructor Detail
-
BeanCodeGen
public BeanCodeGen(List<File> files, BeanGenConfig config, int verbosity, boolean write)
Creates the generator for a single bean.To generate, use
process()
.- Parameters:
files
- the files to process, not nullconfig
- the configuration to use, not nullverbosity
- the verbosity, from 0 to 3write
- whether to write or not
-
-
Method Detail
-
main
public static void main(String[] args)
Main method.This calls
System.exit
.- Parameters:
args
- the arguments, not null
-
createFromArgs
public static BeanCodeGen createFromArgs(String[] args)
Creates an instance ofBeanCodeGen
from arguments.This is intended for tools and does not call
System.exit
.- Parameters:
args
- the arguments, not null- Returns:
- the code generator, not null
- Throws:
RuntimeException
- if unable to create
-
process
public int process() throws Exception
Processes the file, recursing as necessary, generating the source code.The number of altered files is returned.
- Returns:
- the number of changed files
- Throws:
Exception
- if an error occurs
-
-