public abstract class PropertyCodeGenerator extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PropertyCodeGenerator.Type
Property type.
|
| Modifier and Type | Field and Description |
|---|---|
protected Metadata.Property |
property |
| Constructor and Description |
|---|
PropertyCodeGenerator(Metadata.Property property) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addBuilderFieldAccessors(SourceWriter code,
Metadata metadata)
Add the accessor methods for the property to the builder's source code.
|
abstract void |
addBuilderFieldDeclaration(SourceWriter code)
Add the field declaration for the property to the builder's source code.
|
abstract void |
addClear(SourceWriter code,
String template)
Adds a clear call for the property given a template builder to the builder's source code.
|
abstract void |
addFinalFieldAssignment(SourceWriter code,
String finalField,
String builder)
Add the final assignment of the property to the value object's source code.
|
abstract void |
addMergeFromBuilder(SourceWriter code,
Metadata metadata,
String builder)
Add a merge from builder for the property to the builder's source code.
|
abstract void |
addMergeFromValue(SourceWriter code,
String value)
Add a merge from value for the property to the builder's source code.
|
abstract void |
addPartialClear(SourceWriter code)
Adds a partial clear call for the property to the builder's source code.
|
void |
addPartialFieldAssignment(SourceWriter code,
String finalField,
String builder)
Add the final assignment of the property to the partial value object's source code.
|
void |
addReadValueFragment(SourceWriter code,
String finalField)
Adds a fragment converting the value object's field to the property's type.
|
abstract void |
addSetFromResult(SourceWriter code,
String builder,
String variable)
Adds a set call for the property from a function result to the builder's source code.
|
void |
addValueFieldDeclaration(SourceWriter 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.
|
protected final Metadata.Property property
public PropertyCodeGenerator(Metadata.Property property)
public PropertyCodeGenerator.Type getType()
public void addValueFieldDeclaration(SourceWriter code, String finalField)
public abstract void addBuilderFieldDeclaration(SourceWriter code)
public abstract void addBuilderFieldAccessors(SourceWriter code, Metadata metadata)
public abstract void addFinalFieldAssignment(SourceWriter code, String finalField, String builder)
public void addPartialFieldAssignment(SourceWriter code, String finalField, String builder)
public abstract void addMergeFromValue(SourceWriter code, String value)
public abstract void addMergeFromBuilder(SourceWriter code, Metadata metadata, String builder)
public void addReadValueFragment(SourceWriter code, String finalField)
public abstract void addSetFromResult(SourceWriter code, String builder, String variable)
public abstract void addClear(SourceWriter code, String template)
public abstract void addPartialClear(SourceWriter code)
Copyright © 2015 Google, Inc.. All rights reserved.