public class GenerationContext extends Object
| Modifier and Type | Field and Description |
|---|---|
static ClassLoader |
DEFAULT_CLASSLOADER |
File |
resourcesOutputDirectory |
File |
resourcesRootDirectory
the output directory for the code generation
|
static GenerationContext |
SINGLETON |
| Constructor and Description |
|---|
GenerationContext(String packageName,
String sepClassName,
File outputDirectory,
File resourcesRootDirectory) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
addOrUseExistingNode(T node) |
void |
createResourceDirectory() |
<K,V> Map<K,V> |
getCache(Object key)
a cache that is tied to this generation context instance.
|
List<Object> |
getNodeList() |
<T> T |
nameNode(T node,
String name) |
static int |
nextId()
A global counter, can be used for generating unique class names.
|
int |
nextId(String className) |
static String |
readText(String resourceName) |
<K,V> Map<K,V> |
removeCache(Object key)
removes a cache map from this instance by key.
|
static void |
setupStaticContext(ClassLoader classLoader,
String packageName,
String className,
File outputDirectory,
File resourcesRootDirectory,
boolean createResourceDirectory,
File buildOutputDirectory,
boolean createBuildOutputDirectory) |
static void |
setupStaticContext(String packageName,
String className,
File outputDirectory,
File resourcesRootDirectory) |
static void |
setupStaticContext(String packageName,
String className,
File outputDirectory,
File resourcesRootDirectory,
boolean createResourceDirectory) |
public static GenerationContext SINGLETON
public static ClassLoader DEFAULT_CLASSLOADER
public File resourcesRootDirectory
public File resourcesOutputDirectory
public static int nextId()
public int nextId(String className)
public static void setupStaticContext(String packageName, String className, File outputDirectory, File resourcesRootDirectory)
public static void setupStaticContext(String packageName, String className, File outputDirectory, File resourcesRootDirectory, boolean createResourceDirectory)
public static void setupStaticContext(ClassLoader classLoader, String packageName, String className, File outputDirectory, File resourcesRootDirectory, boolean createResourceDirectory, File buildOutputDirectory, boolean createBuildOutputDirectory)
public void createResourceDirectory()
public <T> T addOrUseExistingNode(T node)
public <K,V> Map<K,V> getCache(Object key)
K - The key type of the cache mapV - The value type of the cache mapkey - the cache keypublic <T> T nameNode(T node,
String name)
public <K,V> Map<K,V> removeCache(Object key)
K - The key type of the cache mapV - The value type of the cache mapkey - the cache keypublic static String readText(@NotNull String resourceName) throws IOException
IOExceptionCopyright © 2022. All rights reserved.