TestTransformerListener.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:carbon-platform-integration 作者:
@Override
public void transform(IConfigurationAnnotation iConfigurationAnnotation, Class aClass,
                      Constructor constructor, Method method) {
    if (method != null) {
        try {
            context = new AutomationContext();
            Annotation classAnnotation = method.getDeclaringClass().getAnnotation(SetEnvironment.class);
            Annotation methodAnnotation = method.getAnnotation(SetEnvironment.class);
            log.info("Started Configuration Transform manager  " + method.getName());
            //skip configuration methods if class level custom annotation is set.
            if (classAnnotation != null) {
                if (!annotationComparator(classAnnotation.toString())) {
                    iConfigurationAnnotation.setEnabled(false);
                    log.info("Skipped Configuration method <" + method.getName() + "> on " +
                            "annotation <" + classAnnotation.toString() + ">");
                }
                //skip configuration methods if configuration method level custom annotation is set.
            } else if (methodAnnotation != null) {
                if (!annotationComparator(methodAnnotation.toString())) {
                    iConfigurationAnnotation.setEnabled(false);
                    log.info("Skipped Configuration method <" + method.getName() + "> on " +
                            "annotation <" + methodAnnotation.toString() + ">");
                }
            }
        } catch (Exception e) {
            handleException("Error transform custom annotations ", e);
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号