org.joda.beans.gen
Class BeanCodeGen

java.lang.Object
  extended by 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
BeanCodeGen(List<File> files, BeanGenConfig config, int verbosity, boolean write)
          Creates the generator for a single bean.
BeanCodeGen(List<File> files, String indent, String prefix, int verbosity, boolean write)
          Deprecated. Use BeanGenConfig constructor
 
Method Summary
static BeanCodeGen createFromArgs(String[] args)
          Creates an instance of BeanCodeGen 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanCodeGen

@Deprecated
public BeanCodeGen(List<File> files,
                              String indent,
                              String prefix,
                              int verbosity,
                              boolean write)
Deprecated. Use BeanGenConfig constructor

Creates the generator for a single bean.

To generate, use process().

Parameters:
files - the files to process, not null
indent - the indent to use, which will be directly inserted in the output, not null
prefix - the prefix to use, which will be directly inserted in the output, not null
verbosity - the verbosity, from 0 to 3
write - whether to write or not

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 null
config - the configuration to use, not null
verbosity - the verbosity, from 0 to 3
write - 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 of BeanCodeGen 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

processFiles

public List<File> processFiles()
                        throws Exception
Processes the file, recursing as necessary, generating the source code.

The list of altered files is returned.

Returns:
the list of changed files, not null
Throws:
Exception


Copyright © 2007–2015 Joda.org. All rights reserved.