Java ????????
???????????? ???????[ 2015/9/23 10:45:29 ] ??????????????????? ???????
??????????????????÷???
????????????????????????????п??????????????????star?????????????????issue????????и????????????pull request??????????????????????jOOR?б?д????????????????????????????
???????????
???????“??”???????????????“??????鷳????????????”
??????????仰???????????????ù???????????????????
??????????д??????????д??
????public static <T> T create(HttpRequest httpRequest) {
????Object httpRequestEntity = null;
????try {
????Class<T> httpRequestEntityCls = (Class<T>) Class.forName(HttpProcessor.PACKAGE_NAME + "." + HttpProcessor.CLASS_NAME);
????Constructor con = httpRequestEntityCls.getConstructor(HttpRequest.class);
????httpRequestEntity = con.newInstance(httpRequest);
????} catch (ClassNotFoundException e) {
????e.printStackTrace();
????} catch (InstantiationException e) {
????e.printStackTrace();
????} catch (IllegalAccessException e) {
????e.printStackTrace();
????} catch (NoSuchMethodException e) {
????e.printStackTrace();
????} catch (InvocationTargetException e) {
????e.printStackTrace();
????}
????return (T) httpRequestEntity;
????}
?????????????????к??????????????????????????????????д?Щ??????????????????????api????????????????api????????飬???????????????£???????????????????д????????????????????????д?????????????????
????String str = new String();
??????????????д????????
?????????к??????????????????????????????????÷?????????????÷?????????÷???????????????????????????????????????÷?????????????????????
????????????
??????????????????????????????????????????????????
??????????????????“?????????api???????????????????鰡???????鷳??д??????????????????????????????????”
???????????????д?鷳????????????????????????????????????????????д?????????е?findViewById?????????????xml??????????????????
??????????????????????????????????????????????????????????????д?????????д????????????
??????????????????????????÷?????????
????1. ???乹????????????????
????2. set??get???????????????
????3. ???ò??????????
???????????????
????3.1 ??д???д????
??????????Android?????????????TextView????????ɡ??????????????????
????TextView mTv;
??????????????????
????// ??????????????
????mTv = Reflect.on(TextView.class).create(this).get();
????// ?????????????
????String word = Reflect.on("java.lang.String").create("Reflect TextView").get();
????// ?????????????
????Fragment fragment = Reflect.on(Fragment.class).create().get();
?????????????÷?????
????// ?????????????
????L.d("call getText() : " + Reflect.on(mTv).call("getText").toString());
????// ?????в???????
????Reflect.on(mTv).call("setTextColor"?? 0xffff0000);
???????????get??set?????
????TextView???и?mText??????????????????????????
????// ???ò???
????Reflect.on(mTv).set("mText"?? "---------- new Reflect TextView ----------");
????// ??ò???
????L.d("setgetParam is " + Reflect.on(mTv).get("mText"));
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11