public abstract class PropertyCodeGenerator extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PropertyCodeGenerator.Type
Property type.
|
| Modifier and Type | Field and Description |
|---|---|
static com.google.common.base.Predicate<PropertyCodeGenerator> |
IS_TEMPLATE_REQUIRED_IN_CLEAR |
protected Metadata.Property |
property |
| Constructor and Description |
|---|
PropertyCodeGenerator(Metadata.Property property) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addBuilderFieldAccessors(SourceBuilder code,
Metadata metadata)
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 |
addClear(SourceBuilder code,
String template)
Adds a clear call for the property given a template builder to the builder's source code.
|
abstract void |
addFinalFieldAssignment(SourceBuilder code,
String finalField,
String builder)
Add the final assignment of the property to the value object's source code.
|
abstract void |
addMergeFromBuilder(SourceBuilder code,
Metadata metadata,
String builder)
Add a merge from builder for the property to the builder's source code.
|
abstract void |
addMergeFromValue(SourceBuilder code,
String value)
Add a merge from value for the property to the builder's source code.
|
abstract void |
addPartialClear(SourceBuilder code)
Adds a partial clear call for the property to the builder's source code.
|
void |
addPartialFieldAssignment(SourceBuilder code,
String finalField,
String builder)
Add the final assignment of the property to the partial value object's source code.
|
void |
addReadValueFragment(SourceBuilder code,
String finalField)
Adds a fragment converting the value object's field to the property's type.
|
abstract void |
addSetFromResult(SourceBuilder code,
String builder,
String variable)
Adds a set call for the property from a function result to the builder's source code.
|
void |
addValueFieldDeclaration(SourceBuilder code,
String finalField)
Add the field declaration for the property to the value's source code.
|
PropertyCodeGenerator.Type |
getType()
Returns whether the property is required, optional, or has a default.
|
abstract boolean |
isTemplateRequiredInClear()
Returns true if the clear method requires a template builder to operate correctly.
|
protected final Metadata.Property property
public static final com.google.common.base.Predicate<PropertyCodeGenerator> IS_TEMPLATE_REQUIRED_IN_CLEAR
public PropertyCodeGenerator(Metadata.Property property)
public PropertyCodeGenerator.Type getType()
public void addValueFieldDeclaration(SourceBuilder code, String finalField)
public abstract void addBuilderFieldDeclaration(SourceBuilder code)
public abstract void addBuilderFieldAccessors(SourceBuilder code, Metadata metadata)
public abstract void addFinalFieldAssignment(SourceBuilder code, String finalField, String builder)
public void addPartialFieldAssignment(SourceBuilder code, String finalField, String builder)
public abstract void addMergeFromValue(SourceBuilder code, String value)
public abstract void addMergeFromBuilder(SourceBuilder code, Metadata metadata, String builder)
public void addReadValueFragment(SourceBuilder code, String finalField)
public abstract void addSetFromResult(SourceBuilder code, String builder, String variable)
public abstract boolean isTemplateRequiredInClear()
public abstract void addClear(SourceBuilder code, String template)
public abstract void addPartialClear(SourceBuilder code)
Copyright © 2015 Google, Inc.. All rights reserved.