public class GenerateMethodWriter2 extends AbstractClassGenerator<GenerateMethodWriter2.GMWMetaData>
GenerateMethodWriter2 class is responsible for generating method writers based on the provided metadata.
It extends the AbstractClassGenerator with metadata type GenerateMethodWriter2.GMWMetaData. This class internally maintains
a set of template methods that help in the method writer generation. These templates are based on certain method names
and parameter types, which define their structure.
| Modifier and Type | Class and Description |
|---|---|
static class |
GenerateMethodWriter2.GMWMetaData
Metadata associated with the
GenerateMethodWriter2 class. |
AbstractClassGenerator.MetaData<M extends AbstractClassGenerator.MetaData<M>>CACHED_COMPILER, importSet, sourceCode| Constructor and Description |
|---|
GenerateMethodWriter2()
Default constructor that initializes the metadata and sets up necessary imports.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
generateConstructors(SourceCodeFormatter mainCode)
Generates constructors for the class.
|
protected void |
generateEnd(SourceCodeFormatter mainCode)
Stub method for subclasses to implement end code generation, if necessary.
|
protected void |
generateFields(SourceCodeFormatter mainCode)
Generates fields for the class.
|
protected void |
generateMethod(Method method,
StringBuilder params,
List<String> paramList,
SourceCodeFormatter mainCode)
Abstract method for subclasses to implement the body of the generated method.
|
acquireClass, className, extendsClass, fieldCase, generateGenericType, generateMainCode, generateMethod, maxCode, maxCode, metaData, methodsToOverride, nameForClass, withLineNumberpublic GenerateMethodWriter2()
protected void generateFields(SourceCodeFormatter mainCode)
AbstractClassGeneratorgenerateFields in class AbstractClassGenerator<GenerateMethodWriter2.GMWMetaData>mainCode - The code formatter where the generated code is appended.protected void generateConstructors(SourceCodeFormatter mainCode)
AbstractClassGeneratorgenerateConstructors in class AbstractClassGenerator<GenerateMethodWriter2.GMWMetaData>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<GenerateMethodWriter2.GMWMetaData>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 void generateEnd(SourceCodeFormatter mainCode)
AbstractClassGeneratorgenerateEnd in class AbstractClassGenerator<GenerateMethodWriter2.GMWMetaData>mainCode - The code formatter where the generated code is appended.Copyright © 2024. All rights reserved.