public class Declarations
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.util.Optional<Variable> |
freshBuilder(SourceBuilder code,
Datatype datatype)
Declares a fresh Builder to copy default property values from.
|
static Variable |
upcastToGeneratedBuilder(SourceBuilder code,
Datatype datatype,
java.lang.String builder)
Upcasts a Builder instance to the generated superclass, to allow access to private fields.
|
public static Variable upcastToGeneratedBuilder(SourceBuilder code, Datatype datatype, java.lang.String builder)
Reuses an existing upcast instance if one was already declared in this scope.
code - the SourceBuilder to add the declaration todatatype - metadata about the user type the builder is being generated forbuilder - the Builder instance to upcastpublic static java.util.Optional<Variable> freshBuilder(SourceBuilder code, Datatype datatype)
Reuses an existing fresh Builder instance if one was already declared in this scope.