Skip to content

Commit be25e04

Browse files
committed
[anno] [add missing doc]
1 parent 12a6023 commit be25e04

File tree

13 files changed

+46
-29
lines changed

13 files changed

+46
-29
lines changed

componentlib/src/main/java/com/mrzhang/component/componentlib/router/RouterConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
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

componentlib/src/main/java/com/mrzhang/component/componentlib/router/facade/ISyringe.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
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

1112
public 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
}
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
package 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

1117
public 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
}

dicomponent/src/main/java/com/ljsw/component/di/applike/DepInjectAppLike.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,19 @@
33
import com.ljsw.component.di.serviceimpl.AutowiredServiceImpl;
44
import com.mrzhang.component.componentlib.applicationlike.IApplicationLike;
55
import com.mrzhang.component.componentlib.router.Router;
6-
import com.mrzhang.component.componentlib.router.ui.UIRouter;
76
import 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

1716
public 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());

dicomponent/src/main/java/com/ljsw/component/di/serviceimpl/AutowiredServiceImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
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

dicomponent/src/main/runalone/java/com/ljsw/component/di/runalone/application/DIApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
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

jsoncomponent/src/main/java/com/ljsw/component/json/applike/JsonAppLike.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,20 @@
33
import com.ljsw.component.json.serviceimpl.JsonServiceImpl;
44
import com.mrzhang.component.componentlib.applicationlike.IApplicationLike;
55
import com.mrzhang.component.componentlib.router.Router;
6-
import com.mrzhang.component.componentlib.router.ui.UIRouter;
76
import 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

1716
public 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());

jsoncomponent/src/main/java/com/ljsw/component/json/serviceimpl/JsonServiceImpl.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,31 @@
33
import com.alibaba.fastjson.JSON;
44
import 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

1418
public 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
}

jsoncomponent/src/main/runalone/java/com/ljsw/component/json/runalone/application/JsonApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
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

router-anno-compiler/src/main/java/com/ljsw/router/compiler/utils/Constants.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
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";

0 commit comments

Comments
 (0)