学习路径
- 1, 入门篇
- 1),
- 2),
- 3),
- 4),
- 2, 专题篇
- 1),
- 2),
- 3),
- 3, 源码阅读
- 1),
数组,列表,SparseArray的属性。
- 就以之前的 模型 Student来举例说明.
//age是数组属性//name是list属性//id 是SparseArray属性@Fields( { @Field(propName = "age" , type = int.class, complexType = COMPLEX_ARRAY), @Field(propName = "name" , type = String.class, complexType = COMPLEX_LIST), @Field(propName = "id" , type = long.class, complexType = COMPLEX_SPARSE_ARRAY),})public interface Student{}复制代码
- 生成的模型代码:
@Fields( { @Field(propName = "age" , type = int.class, complexType = COMPLEX_ARRAY), @Field(propName = "name" , type = String.class, complexType = COMPLEX_LIST), @Field(propName = "id" , type = long.class, complexType = COMPLEX_SPARSE_ARRAY),})public interface Student extends Serializable, Parcelable, DataPools.Poolable { Property PROP_age = SharedProperties.get(int.class.getName(), "age", 1); Property PROP_name = SharedProperties.get(String.class.getName(), "name", 2); Property PROP_id = SharedProperties.get(long.class.getName(), "id", 3); Student setAge(int[] age1); int[] getAge(); Student setName(Listname1); List getName(); ListPropertyEditor beginNameEditor(); Student setId(SparseArray id1); SparseArray getId(); SparseArrayPropertyEditor beginIdEditor();}复制代码
下一章
想要体验最新的特性 ?
请到体验。 如果觉得不错,请star支持下项目哈。