/** * Created by heaven7 on 2017/10/29. */ @Fields({ @Field(propName = "id", seriaName = "_id", since = 1.1, until = 1.5), @Field(propName = "test", flags = FieldFlags.FLAGS_MAIN_SCOPES_2 &~ FieldFlags.FLAG_GSON_PERSISTENCE) }) public interface GsonTest extends DataPools.Poolable { Property PROP_id = SharedProperties.get(String.class.getName(), "id", 0); Property PROP_test = SharedProperties.get(String.class.getName(), "test", 0); GsonTest setId(String id1); String getId(); GsonTest setTest(String test1); String getTest(); }
@Override protected boolean hasAnnotation(TypeElement te) { Fields fields = te.getAnnotation(Fields.class); if(fields == null){ return false; } return fields.families().length > 0; }
protected boolean hasAnnotation(TypeElement te) { Fields fields = te.getAnnotation(Fields.class); return fields != null && fields.groups().length > 0; }
/** * Created by heaven7 on 2018/6/27. */ @Fields(value = { @Field(propName = "state", type = int.class) }, groups = { @GroupDesc(prop = "state", focusVal = 1, oppositeVal = -1) }) public interface TestGroupProperty extends DataPools.Poolable { Property PROP_state = SharedProperties.get("int", "state", 0); TestGroupProperty setState(int state1); int getState();/* ================== start methods from super properties =============== ======================================================================= */ }
@Override protected boolean hasAnnotation(TypeElement te) { Fields fields = te.getAnnotation(Fields.class); if(fields == null){ return false; } return fields.families().length > 0; }
protected boolean hasAnnotation(TypeElement te) { Fields fields = te.getAnnotation(Fields.class); return fields != null && fields.groups().length > 0; }
@Fields(value = { @Field(propName = "name"), @Field(propName = "id", seriaName = "_id"),
@Fields(value = { @Field(propName = "id", type = Student.class, since = 1.2, until = 2.0), @Field(propName = "name" ),
/** * Created by heaven7 on 2017/9/26 0026. */ @Fields({ @Field(propName = "students", type = Student.class, complexType = COMPLEXT_LIST) }) public interface RecyclerListBind extends DataPools.Poolable { Property PROP_students = SharedProperties.get(Student.class.getName(), "students", 2); RecyclerListBind setStudents(List<Student> students1); List<Student> getStudents(); ListPropertyEditor<? extends RecyclerListBind, Student> beginStudentsEditor(); }
@Fields(value = {@Field(propName = "text") }, generateJsonAdapter = false) public interface IInner2_2 extends DataPools.Poolable { Property PROP_text = SharedProperties.get(String.class.getName(), "text", 0); IInner2_2 setText(String text1); String getText(); }
@Fields(value = {
@Fields(value = {@Field(propName = "test_int", seriaName = "test_int", type = int.class), @Field(propName = "test_long", type = long.class, flags = FieldFlags.FLAGS_MAIN_SCOPES_2 | FieldFlags.FLAG_EXPOSE_DEFAULT | FieldFlags.FLAG_EXPOSE_DESERIALIZE_FALSE), @Field(propName = "test_byte", type = byte.class, since = 1.1),
@Fields(value = {@Field(propName = "testInner1") }, generateJsonAdapter = false) public interface ITestInner1 extends Outter2.Inner2_1.IInner2_2 { Property PROP_testInner1 = SharedProperties.get(String.class.getName(), "testInner1", 0); ITestInner1 setTestInner1(String testInner11); String getTestInner1();/* ================== start methods from super properties =============== ======================================================================= */ ITestInner1 setText(String text1); }
/** * test self method /impl interface */ @Fields({ @Field(propName = "text") }) public interface TestSelfMethod extends TestSelfMethodWithImplInterface.TextDelegate, DataPools.Poolable { Property PROP_text = SharedProperties.get("java.lang.String", "text", 0); @ImplMethod(from = HelpUtil.class) void changeText(String text); TestSelfMethod setText(String text1); String getText();/* ================== start methods from super properties =============== ======================================================================= */ class HelpUtil { //compare to ' void changeText(String text);' , just add a module param at the first. public static void changeText(TestSelfMethod module, String text) { //just mock text change. //module can be real data or data proxy, if is proxy it will auto dispatch text change event. module.setText(text); } } }
/** * test self method /impl interface */ @Fields({ @Field(propName = "text2") }) public interface TestSelfMethod2 extends TestSelfMethodWithImplInterface.TestSelfMethod{ Property PROP_text2 = SharedProperties.get(String.class.getName(), "text2", 0); TestSelfMethod2 setText2(String text21); String getText2();/* ================== start methods from super properties =============== ======================================================================= */ TestSelfMethod2 setText(String text1); }
@Fields({ @Field(propName = "test_self1"), @Field(propName = "test_self2", type = int.class)
@Fields({ @Field(propName = "text3") }) public interface TestSelfMethod3 extends TestSelfMethodWithImplInterface.TestSelfMethod, Parcelable{ Property PROP_text3 = SharedProperties.get("java.lang.String", "text3", 0); TestSelfMethod3 setText3(String text31); String getText3();/* ================== start methods from super properties =============== ======================================================================= */ TestSelfMethod3 setText(String text1); } }
@Fields({ @Field(propName = "text2") }) interface Child extends Parent{ Property PROP_text2 = SharedProperties.get("java.lang.String", "text2", 0); Child setText2(String text21); String getText2(); Child setText1(String text11); } @Fields({
@Fields({ @Field(propName = "text3") }) interface Child2 extends Child{ Property PROP_text3 = SharedProperties.get("java.lang.String", "text3", 0); Child2 setText3(String text31); String getText3(); Child2 setText2(String text21); Child2 setText1(String text11); }
@Fields(value = { @Field(propName = "id", type = Student.class), @Field(propName = "name" ),