public class PackageGenerator extends ClassGenerator
This class is only used manually to recreate the default presenters. It is able to load model classes from a given path or a given jar-file. If you use a jar-file, be sure to set the classpath to find all needed classes! how-to-start: start the main of this class with parameter: 1. package path to find model classes to generate presenters for 2. class name of presenter specialization 3. property-file name example: PackageGenerator bin/org/anonymous/project/ de.tsl2.nano.codegen.PresenterGenerator PackageGenerator lib/mymodel.jar de.tsl2.nano.codegen.PresenterGenerator To constrain the generation to a specific package path, set the environment variable "bean.generation.packagename".
DEFAULT_DEST_POSTFIX, DEFAULT_DEST_PREFIX, DEST_FILENAME_PATTERN, DEST_POSTFIX, DEST_PREFIX, LOG, POSTFIX_CLS, SRC_NAME| Constructor and Description |
|---|
PackageGenerator() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
appendPackage(String modelFile,
String packageName)
appends the given package suffix to the given model class package path
|
void |
generate()
starts the generate process
|
protected void |
generate(Class<?> type)
starts the generator for the given model class
|
protected String |
getDefaultDestinationFile(String modelFile)
override this method to provide a default destination file
|
protected Collection<Class> |
getModelClasses()
override this class to define your model classes
|
protected Properties |
getProperties() |
protected String |
getTemplate(Class<?> type)
override this method, to define the path to your own template.
|
static void |
main(String[] args)
main
|
generate, generate, getDefaultClassloader, getDestinationClassName, getDestinationPackageName, getModel, getUtilityInstance, init, instance, instance, instancepublic static void main(String[] args) throws Exception
args - will be ignoredException - on any errorpublic void generate()
protected Collection<Class> getModelClasses()
protected void generate(Class<?> type) throws Exception
type - type to generateException - on any errorprotected Properties getProperties()
protected String getTemplate(Class<?> type)
type - protected String getDefaultDestinationFile(String modelFile)
getDefaultDestinationFile in class ClassGeneratormodelFile - source fileClassGenerator.getModel(String, ClassLoader)Copyright © 2012–2018. All rights reserved.