public abstract class PropertyCodeGenerator
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
PropertyCodeGenerator.Config
Data available to
PropertyCodeGenerator.Factory instances when creating a PropertyCodeGenerator. |
static interface |
PropertyCodeGenerator.Factory
Factory interface for
PropertyCodeGenerator. |
static class |
PropertyCodeGenerator.Initially
General behaviour type for a fresh or reset property.
|
| Modifier and Type | Field and Description |
|---|---|
protected Datatype |
datatype |
protected Property |
property |
| Constructor and Description |
|---|
PropertyCodeGenerator(Datatype datatype,
Property property) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAccessorAnnotations(SourceBuilder code) |
abstract void |
addAssignToBuilder(SourceBuilder code,
Variable builder)
Adds an assignment to the field on the builder from the Value/Partial implementation.
|
abstract void |
addBuilderFieldAccessors(SourceBuilder code)
Add the accessor methods for the property to the builder's source code.
|
abstract void |
addBuilderFieldDeclaration(SourceBuilder code)
Add the field declaration for the property to the builder's source code.
|
abstract void |
addClearField(SourceBuilder code)
Adds a clear call for the property given a template builder to the builder's source code.
|
abstract void |
addFinalFieldAssignment(SourceBuilder code,
Excerpt finalField,
java.lang.String builder)
Add the final assignment of the property to the value object's source code.
|
void |
addGetterAnnotations(SourceBuilder code)
Adds method annotations for the value type getter method.
|
abstract void |
addMergeFromBuilder(SourceBuilder code,
java.lang.String builder)
Add a merge from builder for the property to the builder's source code.
|
abstract void |
addMergeFromValue(SourceBuilder code,
java.lang.String value)
Add a merge from value for the property to the builder's source code.
|
void |
addPartialFieldAssignment(SourceBuilder code,
Excerpt finalField,
java.lang.String builder)
Add the final assignment of the property to the partial value object's source code.
|
void |
addPutAnnotations(SourceBuilder code) |
void |
addReadValueFragment(SourceBuilder code,
Excerpt finalField)
Adds a fragment converting the value object's field to the property's type.
|
abstract void |
addSetFromResult(SourceBuilder code,
Excerpt builder,
Excerpt variable)
Adds a set call for the property from a function result to the builder's source code.
|
void |
addToStringCondition(SourceBuilder code)
Adds condition statement for an initially optional property to be included in the toString
output for the Value/Partial types.
|
void |
addToStringValue(SourceBuilder code)
Adds value to an ongoing toString concatenation or append sequence.
|
abstract void |
addValueFieldDeclaration(SourceBuilder code)
Add the field declaration for the property to the value's source code.
|
boolean |
equals(java.lang.Object obj) |
abstract java.util.Set<MergeAction> |
getMergeActions()
Returns the actions taken in mergeFrom, for generating JavaDoc.
|
int |
hashCode() |
PropertyCodeGenerator.Initially |
initialState()
Returns whether the property is required, optional, or has a default.
|
java.lang.String |
toString() |
public PropertyCodeGenerator.Initially initialState()
public abstract void addValueFieldDeclaration(SourceBuilder code)
public abstract void addBuilderFieldDeclaration(SourceBuilder code)
public abstract void addBuilderFieldAccessors(SourceBuilder code)
public abstract void addFinalFieldAssignment(SourceBuilder code, Excerpt finalField, java.lang.String builder)
public void addPartialFieldAssignment(SourceBuilder code, Excerpt finalField, java.lang.String builder)
public abstract void addAssignToBuilder(SourceBuilder code, Variable builder)
public abstract void addMergeFromValue(SourceBuilder code, java.lang.String value)
public abstract void addMergeFromBuilder(SourceBuilder code, java.lang.String builder)
public abstract java.util.Set<MergeAction> getMergeActions()
public void addGetterAnnotations(SourceBuilder code)
public void addReadValueFragment(SourceBuilder code, Excerpt finalField)
public abstract void addSetFromResult(SourceBuilder code, Excerpt builder, Excerpt variable)
public abstract void addClearField(SourceBuilder code)
public void addToStringCondition(SourceBuilder code)
java.lang.IllegalStateException - if initialState() is not PropertyCodeGenerator.Initially.OPTIONALpublic void addToStringValue(SourceBuilder code)
public void addAccessorAnnotations(SourceBuilder code)
public void addPutAnnotations(SourceBuilder code)
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object