Class PropertyCodeGenerator
java.lang.Object
org.inferred.freebuilder.processor.property.PropertyCodeGenerator
- Direct Known Subclasses:
BiMapProperty,BuildableListProperty,BuildableProperty,DefaultProperty,ListMultimapProperty,ListProperty,MapProperty,MultisetProperty,NullableProperty,OptionalProperty,PrimitiveOptionalProperty,SetMultimapProperty,SetProperty,SortedSetProperty
Property-type-specific code generation interface.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceData available toPropertyCodeGenerator.Factoryinstances when creating aPropertyCodeGenerator.static interfaceFactory interface forPropertyCodeGenerator.static enumGeneral behaviour type for a fresh or reset property. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabstract voidaddAssignToBuilder(SourceBuilder code, Variable builder) Adds an assignment to the field on the builder from the Value/Partial implementation.abstract voidAdd the accessor methods for the property to the builder's source code.abstract voidAdd the field declaration for the property to the builder's source code.abstract voidaddClearField(SourceBuilder code) Adds a clear call for the property given a template builder to the builder's source code.private voidaddFieldValues(Class<?> cls, com.google.common.collect.ImmutableMap.Builder<String, Object> valuesBuilder) abstract voidaddFinalFieldAssignment(SourceBuilder code, Excerpt finalField, String builder) Add the final assignment of the property to the value object's source code.voidAdds method annotations for the value type getter method.abstract voidaddMergeFromBuilder(SourceBuilder code, String builder) Add a merge from builder for the property to the builder's source code.abstract voidaddMergeFromValue(SourceBuilder code, String value) Add a merge from value for the property to the builder's source code.voidaddPartialFieldAssignment(SourceBuilder code, Excerpt finalField, String builder) Add the final assignment of the property to the partial value object's source code.voidvoidaddReadValueFragment(SourceBuilder code, Excerpt finalField) Adds a fragment converting the value object's field to the property's type.abstract voidaddSetFromResult(SourceBuilder code, Excerpt builder, Excerpt variable) Adds a set call for the property from a function result to the builder's source code.voidAdds condition statement for an initially optional property to be included in the toString output for the Value/Partial types.voidAdds value to an ongoing toString concatenation or append sequence.abstract voidAdd the field declaration for the property to the value's source code.booleanabstract Set<MergeAction> Returns the actions taken in mergeFrom, for generating JavaDoc.inthashCode()Returns whether the property is required, optional, or has a default.toString()
-
Field Details
-
datatype
-
property
-
-
Constructor Details
-
PropertyCodeGenerator
-
-
Method Details
-
initialState
Returns whether the property is required, optional, or has a default. -
addValueFieldDeclaration
Add the field declaration for the property to the value's source code. -
addBuilderFieldDeclaration
Add the field declaration for the property to the builder's source code. -
addBuilderFieldAccessors
Add the accessor methods for the property to the builder's source code. -
addFinalFieldAssignment
public abstract void addFinalFieldAssignment(SourceBuilder code, Excerpt finalField, String builder) Add the final assignment of the property to the value object's source code. -
addPartialFieldAssignment
Add the final assignment of the property to the partial value object's source code. -
addAssignToBuilder
Adds an assignment to the field on the builder from the Value/Partial implementation. -
addMergeFromValue
Add a merge from value for the property to the builder's source code. -
addMergeFromBuilder
Add a merge from builder for the property to the builder's source code. -
getMergeActions
Returns the actions taken in mergeFrom, for generating JavaDoc. -
addGetterAnnotations
Adds method annotations for the value type getter method. -
addReadValueFragment
Adds a fragment converting the value object's field to the property's type. -
addSetFromResult
Adds a set call for the property from a function result to the builder's source code. -
addClearField
Adds a clear call for the property given a template builder to the builder's source code. -
addToStringCondition
Adds condition statement for an initially optional property to be included in the toString output for the Value/Partial types.- Throws:
IllegalStateException- ifinitialState()is notPropertyCodeGenerator.Initially.OPTIONAL
-
addToStringValue
Adds value to an ongoing toString concatenation or append sequence. -
addAccessorAnnotations
-
addPutAnnotations
-
equals
-
hashCode
public int hashCode() -
toString
-
fieldValues
-
addFieldValues
-