jonatasdaniel / andorm

Persistence framework for Android
23 stars 4 forks source link

Option way to assign a value to field #43

Open jonatasdaniel opened 13 years ago

jonatasdaniel commented 13 years ago

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 commented 13 years ago

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.