Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option way to assign a value to field #43

Open
jonatasdaniel opened this issue Aug 15, 2011 · 1 comment
Open

Option way to assign a value to field #43

jonatasdaniel opened this issue Aug 15, 2011 · 1 comment

Comments

@jonatasdaniel
Copy link
Owner

Create an annotation to define the way to assign a value to a field.
Create something like this:

@assignment(AssignmentType.AcessorMethod)
@assignment(AssignmentType.DirectAssignment)

The annotation is for fields and classes, and when a class is annotated with @assignment, then all their fields will receive the same configuration

@jonatasdaniel
Copy link
Owner Author

Create FieldReader and FieldWriter interfaces to do this.

Ex:
public class Property {
//all current attrs, removing setMethod and getMethod
private final FieldReader reader;
private final FieldWriter writer;
}

Then, create DirectAssignmentFieldReader/Writer (or better name) and AcessorMethodFieldReader/Writer (or better name)

By default, use DirectAssignment type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant