Package com.baidu.disconf.client.common.annotations

Examples of com.baidu.disconf.client.common.annotations.DisconfItem


        if (field == null) {
            return null;
        }

        // 获取标注
        DisconfItem disconfItem = method.getAnnotation(DisconfItem.class);

        // 去掉空格
        String key = disconfItem.key().replace(" ", "");

        // field
        disconfCenterItem.setField(field);

        // key
        disconfCenterItem.setKey(key);

        // access
        field.setAccessible(true);

        // object
        disconfCenterItem.setObject(null);

        // value
        if (Modifier.isStatic(field.getModifiers())) {
            try {
                disconfCenterItem.setValue(field.get(null));
            } catch (Exception e) {
                LOGGER.error(e.toString());
                disconfCenterItem.setValue(null);
            }
        } else {
            disconfCenterItem.setValue(null);
        }

        //
        // disConfCommonModel
        DisConfCommonModel disConfCommonModel = makeDisConfCommonModel(
                disconfItem.env(), disconfItem.version());
        disconfCenterItem.setDisConfCommonModel(disConfCommonModel);

        // Disconf-web url
        String url = DisconfWebPathMgr.getRemoteUrlParameter(
                DisClientSysConfig.getInstance().CONF_SERVER_STORE_ACTION,
View Full Code Here


                    .getAnnotation(DisconfFileItem.class);

            // 根据用户设定的注解来获取
            fieldName = disconfFileItem.associateField();
        } else {
            DisconfItem disItem = method.getAnnotation(DisconfItem.class);

            // 根据用户设定的注解来获取
            fieldName = disItem.associateField();
        }

        //
        // 如果用户未设定注解,则猜其名字
        //
View Full Code Here

                    .getAnnotation(DisconfFileItem.class);

            // 根据用户设定的注解来获取
            fieldName = disconfFileItem.associateField();
        } else {
            DisconfItem disItem = method.getAnnotation(DisconfItem.class);

            // 根据用户设定的注解来获取
            fieldName = disItem.associateField();
        }

        //
        // 如果用户未设定注解,则猜其名字
        //
View Full Code Here

        if (field == null) {
            return null;
        }

        // 获取标注
        DisconfItem disconfItem = method.getAnnotation(DisconfItem.class);

        // 去掉空格
        String key = disconfItem.key().replace(" ", "");

        // field
        disconfCenterItem.setField(field);

        // key
        disconfCenterItem.setKey(key);

        // access
        field.setAccessible(true);

        // object
        disconfCenterItem.setObject(null);

        // value
        if (Modifier.isStatic(field.getModifiers())) {
            try {
                disconfCenterItem.setValue(field.get(null));
            } catch (Exception e) {
                LOGGER.error(e.toString());
                disconfCenterItem.setValue(null);
            }
        } else {
            disconfCenterItem.setValue(null);
        }

        //
        // disConfCommonModel
        DisConfCommonModel disConfCommonModel = makeDisConfCommonModel(
                disconfItem.env(), disconfItem.version(), key);
        disconfCenterItem.setDisConfCommonModel(disConfCommonModel);

        // Disconf-web url
        String url = DisconfWebPathMgr.getRemoteUrlParameter(
                DisClientSysConfig.getInstance().CONF_SERVER_STORE_ACTION,
View Full Code Here

                    .getAnnotation(DisconfFileItem.class);

            // 根据用户设定的注解来获取
            fieldName = disconfFileItem.associateField();
        } else {
            DisconfItem disItem = method.getAnnotation(DisconfItem.class);

            // 根据用户设定的注解来获取
            fieldName = disItem.associateField();
        }

        //
        // 如果用户未设定注解,则猜其名字
        //
View Full Code Here

                    .getAnnotation(DisconfFileItem.class);

            // 根据用户设定的注解来获取
            fieldName = disconfFileItem.associateField();
        } else {
            DisconfItem disItem = method.getAnnotation(DisconfItem.class);

            // 根据用户设定的注解来获取
            fieldName = disItem.associateField();
        }

        //
        // 如果用户未设定注解,则猜其名字
        //
View Full Code Here

        if (field == null) {
            return null;
        }

        // 获取标注
        DisconfItem disconfItem = method.getAnnotation(DisconfItem.class);

        // 去掉空格
        String key = disconfItem.key().replace(" ", "");

        // field
        disconfCenterItem.setField(field);

        // key
        disconfCenterItem.setKey(key);

        // access
        field.setAccessible(true);

        // object
        disconfCenterItem.setObject(null);

        // value
        if (Modifier.isStatic(field.getModifiers())) {
            try {
                disconfCenterItem.setValue(field.get(null));
            } catch (Exception e) {
                LOGGER.error(e.toString());
                disconfCenterItem.setValue(null);
            }
        } else {
            disconfCenterItem.setValue(null);
        }

        //
        // disConfCommonModel
        DisConfCommonModel disConfCommonModel = makeDisConfCommonModel(
                disconfItem.env(), disconfItem.version(), key);
        disconfCenterItem.setDisConfCommonModel(disConfCommonModel);

        // Disconf-web url
        String url = DisconfWebPathMgr.getRemoteUrlParameter(
                DisClientSysConfig.getInstance().CONF_SERVER_STORE_ACTION,
View Full Code Here

    public static void printItem(Set<Field> af1) {

        for (Field item : af1) {

            LOGGER.info(item.toString());
            DisconfItem disconfItem = item.getAnnotation(DisconfItem.class);
            LOGGER.info("\tkey: " + disconfItem.key());
            LOGGER.info("\tenv: " + disconfItem.env());
            LOGGER.info("\tversion: " + disconfItem.version());

        }
    }
View Full Code Here

                    .getAnnotation(DisconfFileItem.class);

            // 根据用户设定的注解来获取
            fieldName = disconfFileItem.associateField();
        } else {
            DisconfItem disItem = method.getAnnotation(DisconfItem.class);

            // 根据用户设定的注解来获取
            fieldName = disItem.associateField();
        }

        if (StringUtils.isEmpty(fieldName)) {
            // 从方法名 获取其 Field 名
            fieldName = ClassUtils
View Full Code Here

        if (field == null) {
            return null;
        }

        // 获取标注
        DisconfItem disconfItem = method.getAnnotation(DisconfItem.class);

        // 去掉空格
        String key = disconfItem.key().replace(" ", "");

        // field
        disconfCenterItem.setField(field);

        // key
        disconfCenterItem.setKey(key);

        // access
        field.setAccessible(true);

        // object
        disconfCenterItem.setObject(null);

        // value
        if (Modifier.isStatic(field.getModifiers())) {
            try {
                disconfCenterItem.setValue(field.get(null));
            } catch (Exception e) {
                LOGGER.error(e.toString());
                disconfCenterItem.setValue(null);
            }
        } else {
            disconfCenterItem.setValue(null);
        }

        //
        // disConfCommonModel
        DisConfCommonModel disConfCommonModel = makeDisConfCommonModel(
                disconfItem.env(), disconfItem.version(), ZooPathMgr.joinPath(
                        WatchMgr.getInstance().getClientDisconfItemZooPath(),
                        key));
        disconfCenterItem.setDisConfCommonModel(disConfCommonModel);

        // Disconf-web url
View Full Code Here

TOP

Related Classes of com.baidu.disconf.client.common.annotations.DisconfItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.