Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on #113 for the yaml tests
This feature allows to specify how fields are accessed (inside a container, "can"), with developer extension in mind
User Usage
add the field option corresponding :
Which generates:
Dev extension
Model :
The available canners are listed by the generator, the stream of which can be concatenated to override values
If the option received by the FlatStructureGenerator is such an alias of canner, it is stored in the FieldOptions
At the moment only the empty one (NoCanner) and the Weak Reference one (WeakReferenceCanner) are present.
Those canners can change the actual field type (
String->WeakReference\<String>) , the way it is get (field->field.get()), set (field=param->field= new WeakReference<String>(param)), and app specific property accessor.Default "additional" method is scheduled to allow more complex code additions.
Extension :
If a developer wants to change (ad or replace), he can create his own class, and register them in his own Generator subclass. for example,
would make the default accessor using weak references. Which would fail for primitive but hey ! he can.