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()
Creates a new generator with default
GenerateMethodWriter2.GMWMetaData and registers
the imports required by the generated code. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
generateConstructors(SourceCodeFormatter mainCode)
Emits a constructor that initialises the output supplier, the optional
interceptor and the associated
Closeable. |
protected void |
generateEnd(SourceCodeFormatter mainCode)
Declares any
ThreadLocal fields required for chained writers at
the end of code generation. |
protected void |
generateFields(SourceCodeFormatter mainCode)
Adds fields used by the generated proxy such as the
Closeable,
optional UpdateInterceptor and the supplier of
MarshallableOut instances. |
protected void |
generateMethod(Method method,
StringBuilder params,
List<String> paramList,
SourceCodeFormatter mainCode)
Generates the body of a proxied method.
|
acquireClass, className, extendsClass, fieldCase, generateGenericType, generateMainCode, generateMethod, maxCode, maxCode, metaData, methodsToOverride, nameForClass, withLineNumberpublic GenerateMethodWriter2()
GenerateMethodWriter2.GMWMetaData and registers
the imports required by the generated code.protected void generateFields(SourceCodeFormatter mainCode)
Closeable,
optional UpdateInterceptor and the supplier of
MarshallableOut instances.generateFields in class AbstractClassGenerator<GenerateMethodWriter2.GMWMetaData>mainCode - The code formatter where the generated code is appended.protected void generateConstructors(SourceCodeFormatter mainCode)
Closeable.generateConstructors 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)
WriteDocumentContext, writes the event name or ID and serialises
the arguments. The return type dictates whether the call is terminating
or part of a fluent API.generateMethod 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)
ThreadLocal fields required for chained writers at
the end of code generation.generateEnd in class AbstractClassGenerator<GenerateMethodWriter2.GMWMetaData>mainCode - The code formatter where the generated code is appended.Copyright © 2026 Chronicle Software Ltd. All rights reserved.