File tree Expand file tree Collapse file tree 13 files changed +46
-29
lines changed
componentlib/src/main/java/com/mrzhang/component/componentlib/router
componentservice/src/main/java/com/mrzhang/componentservice/json
java/com/ljsw/component/di
runalone/java/com/ljsw/component/di/runalone/application
java/com/ljsw/component/json
runalone/java/com/ljsw/component/json/runalone/application
router-anno-compiler/src/main/java/com/ljsw/router/compiler/utils
router-annotation/src/main/java/com/ljsw/router/facade/enums Expand file tree Collapse file tree 13 files changed +46
-29
lines changed Original file line number Diff line number Diff line change 44 * <p><b>Package:</b> com.mrzhang.component.componentlib.router </p>
55 * <p><b>Project:</b> DDComponentForAndroid </p>
66 * <p><b>Classname:</b> RouterConstants </p>
7- * <p><b>Description:</b> TODO </p>
7+ * <p><b>Description:</b> Constants use by apt for Router </p>
88 * Created by leobert on 2017/9/18.
99 */
1010
Original file line number Diff line number Diff line change 44 * <p><b>Package:</b> com.mrzhang.component.componentlib.router.facade </p>
55 * <p><b>Project:</b> DDComponentForAndroid </p>
66 * <p><b>Classname:</b> ISyringe </p>
7- * <p><b>Description:</b> TODO </p>
7+ * <p><b>Description:</b> desc the function of Syringe, one that used to inject
8+ * sth. to a container</p>
89 * Created by leobert on 2017/9/18.
910 */
1011
1112public interface ISyringe {
13+ /**
14+ * @param self the container itself, members to be inject into have been annotated
15+ * with one annotation called Autowired
16+ */
1217 void inject (Object self );
1318}
Original file line number Diff line number Diff line change 11package com .mrzhang .componentservice .json ;
22
3+ import java .util .List ;
4+
35/**
46 * <p><b>Package:</b> com.mrzhang.componentservice.json </p>
57 * <p><b>Project:</b> DDComponentForAndroid </p>
68 * <p><b>Classname:</b> JsonService </p>
7- * <p><b>Description:</b> TODO </p>
9+ * <p><b>Description:</b> APIs provided by the JsonComponent.
10+ * <em>you can implement it via fast-json,gson,jackson etc.</em>
11+ *
12+ * currently only basic functions contains!
13+ * </p>
814 * Created by leobert on 2017/9/18.
915 */
1016
1117public interface JsonService {
1218
13- <T > T json2Object (String text , Class <T > clazz );
19+ <T > T parseObject (String text , Class <T > clazz );
20+
21+ <T > List <T > parseArray (String text , Class <T > clazz );
1422
15- String object2Json (Object instance );
23+ String toJsonString (Object instance );
1624
1725}
Original file line number Diff line number Diff line change 33import com .ljsw .component .di .serviceimpl .AutowiredServiceImpl ;
44import com .mrzhang .component .componentlib .applicationlike .IApplicationLike ;
55import com .mrzhang .component .componentlib .router .Router ;
6- import com .mrzhang .component .componentlib .router .ui .UIRouter ;
76import com .mrzhang .componentservice .di .AutowiredService ;
87
98/**
109 * <p><b>Package:</b> com.ljsw.component.di.applike </p>
1110 * <p><b>Project:</b> DDComponentForAndroid </p>
1211 * <p><b>Classname:</b> DepInjectAppLike </p>
13- * <p><b>Description:</b> TODO </p>
12+ * <p><b>Description:</b> component mount/dismount delegate </p>
1413 * Created by leobert on 2017/9/18.
1514 */
1615
1716public class DepInjectAppLike implements IApplicationLike {
18- UIRouter uiRouter = UIRouter .getInstance ();
1917 Router router = Router .getInstance ();
2018
21- //no ui-router for register
22-
2319 @ Override
2420 public void onCreate () {
2521 router .addService (AutowiredService .class .getSimpleName (),new AutowiredServiceImpl ());
Original file line number Diff line number Diff line change 1414 * <p><b>Package:</b> com.ljsw.component.di.serviceimpl </p>
1515 * <p><b>Project:</b> DDComponentForAndroid </p>
1616 * <p><b>Classname:</b> DepInjectServiceImpl </p>
17- * <p><b>Description:</b> TODO </p>
17+ * <p><b>Description:</b> implement of {@link AutowiredService},used to fetch
18+ * data from bundles in the intent</p>
1819 * Created by leobert on 2017/9/18.
1920 */
2021
Original file line number Diff line number Diff line change 66 * <p><b>Package:</b> com.ljsw.component.json.runalone.application </p>
77 * <p><b>Project:</b> DDComponentForAndroid </p>
88 * <p><b>Classname:</b> JsonApplication </p>
9- * <p><b>Description:</b> TODO </p>
9+ * <p><b>Description:</b> dependency inject component runalone application </p>
1010 * Created by leobert on 2017/9/18.
1111 */
1212
Original file line number Diff line number Diff line change 33import com .ljsw .component .json .serviceimpl .JsonServiceImpl ;
44import com .mrzhang .component .componentlib .applicationlike .IApplicationLike ;
55import com .mrzhang .component .componentlib .router .Router ;
6- import com .mrzhang .component .componentlib .router .ui .UIRouter ;
76import com .mrzhang .componentservice .json .JsonService ;
87
98/**
109 * <p><b>Package:</b> com.ljsw.component.json.applike </p>
1110 * <p><b>Project:</b> DDComponentForAndroid </p>
1211 * <p><b>Classname:</b> JsonAppLike </p>
13- * <p><b>Description:</b> TODO </p>
12+ * <p><b>Description:</b> component mount/dismount delegate </p>
1413 * Created by leobert on 2017/9/18.
1514 */
1615
1716public class JsonAppLike implements IApplicationLike {
1817
19- UIRouter uiRouter = UIRouter .getInstance ();
2018 Router router = Router .getInstance ();
2119
22- //no ui-router for register
23-
2420 @ Override
2521 public void onCreate () {
2622 router .addService (JsonService .class .getSimpleName (),new JsonServiceImpl ());
Original file line number Diff line number Diff line change 33import com .alibaba .fastjson .JSON ;
44import com .mrzhang .componentservice .json .JsonService ;
55
6+ import java .util .List ;
7+
68/**
79 * <p><b>Package:</b> com.ljsw.component.json.serviceimpl </p>
810 * <p><b>Project:</b> DDComponentForAndroid </p>
911 * <p><b>Classname:</b> JsonServiceImpl </p>
10- * <p><b>Description:</b> TODO </p>
12+ * <p><b>Description:</b> implement of {@link JsonService}, in this,
13+ * base on fast-json
14+ * </p>
1115 * Created by leobert on 2017/9/18.
1216 */
1317
1418public class JsonServiceImpl implements JsonService {
1519 @ Override
16- public <T > T json2Object (String text , Class <T > clazz ) {
17- return JSON .parseObject (text ,clazz );
20+ public <T > T parseObject (String text , Class <T > clazz ) {
21+ return JSON .parseObject (text , clazz );
22+ }
23+
24+ @ Override
25+ public <T > List <T > parseArray (String text , Class <T > clazz ) {
26+ return JSON .parseArray (text , clazz );
1827 }
1928
2029 @ Override
21- public String object2Json (Object instance ) {
30+ public String toJsonString (Object instance ) {
2231 return JSON .toJSONString (instance );
2332 }
2433}
Original file line number Diff line number Diff line change 66 * <p><b>Package:</b> com.ljsw.component.json.runalone.application </p>
77 * <p><b>Project:</b> DDComponentForAndroid </p>
88 * <p><b>Classname:</b> JsonApplication </p>
9- * <p><b>Description:</b> TODO </p>
9+ * <p><b>Description:</b> json component runalone application </p>
1010 * Created by leobert on 2017/9/18.
1111 */
1212
Original file line number Diff line number Diff line change 44 * <p><b>Package:</b> com.ljsw.router.compiler.utils </p>
55 * <p><b>Project:</b> DDComponentForAndroid </p>
66 * <p><b>Classname:</b> Constants </p>
7- * <p><b>Description:</b> TODO </p>
7+ * <p><b>Description:</b> Constants used by apt </p>
88 * Created by leobert on 2017/9/18.
99 */
1010
@@ -42,9 +42,11 @@ public interface Constants {
4242 String BOOLEAN = LANG + ".Boolean" ;
4343 String STRING = LANG + ".String" ;
4444
45- String TEMPLATE_PACKAGE = ".template" ;
45+ // String TEMPLATE_PACKAGE = ".template";
4646
47- // "com.mrzhang.component.componentlib.router.facade.ISyringe"
47+ // /**
48+ // * see at {@link com.mrzhang.component.componentlib.router.facade.ISyringe}
49+ // */
4850 String ISYRINGE = "com.mrzhang.component.componentlib.router.facade.ISyringe" ;
4951
5052 String JSON_SERVICE = "com.mrzhang.componentservice.json.JsonService" ;
You can’t perform that action at this time.
0 commit comments