public class JavaCodeUtil
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
JavaCodeUtil.PersistentClassChecker |
| Constructor and Description |
|---|
JavaCodeUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
annotate(com.sun.codemodel.JDefinedClass cls,
java.lang.String classType,
java.lang.String location)
Create Java
Generated annotation for a class. |
static void |
annotate(com.sun.codemodel.JDefinedClass cls,
java.lang.String classType,
java.lang.String location,
java.lang.String rootPath)
Create Java
Generated annotation for a class. |
static java.lang.ClassLoader |
classLoaderFromResolverPath(java.lang.String resolverPath) |
static java.lang.String |
getGetterName(com.sun.codemodel.JCodeModel codeModel,
com.sun.codemodel.JType type,
java.lang.String capitalizedName)
Create getter function name for a variable.
|
static java.util.List<java.io.File> |
targetFiles(java.io.File targetDirectory,
com.sun.codemodel.JCodeModel codeModel,
java.lang.ClassLoader classLoader,
JavaCodeUtil.PersistentClassChecker checker)
Build the list of files need to be written from CodeModel, with the targetDirectory as base directory.
|
static java.util.List<java.io.File> |
targetFiles(java.io.File targetDirectory,
com.sun.codemodel.JCodeModel codeModel,
java.lang.ClassLoader classLoader,
JavaCodeUtil.PersistentClassChecker checker,
boolean generateLowercasePath)
Build the list of files need to be written from CodeModel, with the targetDirectory as base directory.
|
public static void annotate(com.sun.codemodel.JDefinedClass cls,
java.lang.String classType,
java.lang.String location)
Generated annotation for a class.cls - CodeModel class to annotateclassType - type of the specified classlocation - location of where the specified class is generated frompublic static void annotate(com.sun.codemodel.JDefinedClass cls,
java.lang.String classType,
java.lang.String location,
java.lang.String rootPath)
Generated annotation for a class.cls - CodeModel class to annotateclassType - type of the specified classlocation - location of where the specified class is generated fromrootPath - root path to relativize the locationpublic static java.lang.String getGetterName(com.sun.codemodel.JCodeModel codeModel,
com.sun.codemodel.JType type,
java.lang.String capitalizedName)
codeModel - JCodeModel instancetype - CodeModel type of the variablecapitalizedName - name of the variablepublic static java.util.List<java.io.File> targetFiles(java.io.File targetDirectory,
com.sun.codemodel.JCodeModel codeModel,
java.lang.ClassLoader classLoader,
JavaCodeUtil.PersistentClassChecker checker)
targetDirectory - directory for the target filescodeModel - JCodeModel instanceclassLoader - Java ClassLoader to check if a class for the potential target file already existchecker - custom closure to check if a class should be persistentpublic static java.util.List<java.io.File> targetFiles(java.io.File targetDirectory,
com.sun.codemodel.JCodeModel codeModel,
java.lang.ClassLoader classLoader,
JavaCodeUtil.PersistentClassChecker checker,
boolean generateLowercasePath)
targetDirectory - directory for the target filescodeModel - JCodeModel instanceclassLoader - Java ClassLoader to check if a class for the potential target file already existchecker - custom closure to check if a class should be persistentgenerateLowercasePath - true, files are generated with a lower case path; false, files are generated as spec specifies.public static java.lang.ClassLoader classLoaderFromResolverPath(java.lang.String resolverPath)