public class GenerateMethodDelegate extends AbstractClassGenerator<GenerateMethodDelegate.GMDMetaData>
| Modifier and Type | Class and Description |
|---|---|
static class |
GenerateMethodDelegate.GMDMetaData
This is an inner static class representing metadata for GenerateMethodDelegate.
|
AbstractClassGenerator.MetaData<M extends AbstractClassGenerator.MetaData<M>>CACHED_COMPILER, importSet, sourceCode| Constructor and Description |
|---|
GenerateMethodDelegate() |
| Modifier and Type | Method and Description |
|---|---|
<T> Class<T> |
acquireClass(ClassLoader classLoader)
Attempts to acquire the generated class.
|
protected void |
generateConstructors(SourceCodeFormatter mainCode)
Generates constructors for the class.
|
protected void |
generateFields(SourceCodeFormatter mainCode)
Generates fields for the class.
|
protected String |
generateGenericType()
Generates a generic type for the class, if required.
|
protected void |
generateMethod(Method method,
SourceCodeFormatter mainCode)
Generates the implementation for a specific method.
|
protected void |
generateMethod(Method method,
StringBuilder params,
List<String> paramList,
SourceCodeFormatter mainCode)
Abstract method for subclasses to implement the body of the generated method.
|
protected SourceCodeFormatter |
getDelegate(SourceCodeFormatter mainCode,
Method method)
Appends the delegate to the main code.
|
protected String |
getDelegateType() |
className, extendsClass, fieldCase, generateEnd, generateMainCode, maxCode, maxCode, metaData, methodsToOverride, nameForClass, withLineNumberpublic <T> Class<T> acquireClass(ClassLoader classLoader)
AbstractClassGeneratoracquireClass in class AbstractClassGenerator<GenerateMethodDelegate.GMDMetaData>T - The type of the generated class.classLoader - The class loader to be used for loading the generated class.protected String generateGenericType()
AbstractClassGeneratorgenerateGenericType in class AbstractClassGenerator<GenerateMethodDelegate.GMDMetaData>protected void generateFields(SourceCodeFormatter mainCode)
AbstractClassGeneratorgenerateFields in class AbstractClassGenerator<GenerateMethodDelegate.GMDMetaData>mainCode - The code formatter where the generated code is appended.protected String getDelegateType()
protected void generateConstructors(SourceCodeFormatter mainCode)
AbstractClassGeneratorgenerateConstructors in class AbstractClassGenerator<GenerateMethodDelegate.GMDMetaData>mainCode - The code formatter where the generated code is appended.protected void generateMethod(Method method, SourceCodeFormatter mainCode)
AbstractClassGeneratorgenerateMethod in class AbstractClassGenerator<GenerateMethodDelegate.GMDMetaData>method - The method whose code is being generated.mainCode - The code formatter where the generated code is appended.protected void generateMethod(Method method, StringBuilder params, List<String> paramList, SourceCodeFormatter mainCode)
AbstractClassGeneratorgenerateMethod in class AbstractClassGenerator<GenerateMethodDelegate.GMDMetaData>method - The method whose body is being generated.params - The parameters of the method in a StringBuilder.paramList - The list of parameter names.mainCode - The code formatter where the generated code is appended.protected SourceCodeFormatter getDelegate(SourceCodeFormatter mainCode, Method method)
mainCode - The SourceCodeFormatter to append the delegate.method - The associated method.Copyright © 2024. All rights reserved.