SyndesisExtensionActionProcessor.java 文件源码

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

项目:syndesis 作者:
protected void writeIfNotEmpty(Properties prop, String key, Object value) throws InvocationTargetException, IllegalAccessException {
    if(value != null && !"".equals(value.toString().trim())) {
        if(value instanceof String[]){
            String[] arr = (String[])value;
            if(arr.length > 0){
                prop.put(key, String.join(",", arr));
            }
        } else if(Object[].class.isInstance(value)) {
            Object[] array = (Object[]) value;
            for (int i=0; i<array.length; i++) {
                if (propertyEnumAnnotationClass.isInstance(array[i])) {
                    Annotation enumAnn = (Annotation) array[i];
                    Properties props = gatherProperties(enumAnn, propertyEnumAnnotationClass);
                    for (String propName : props.stringPropertyNames()) {
                        prop.put(key + "[" + i + "]." + propName, props.getProperty(propName));
                    }
                }
            }
        } else {
            prop.put(key, value.toString());
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号