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());
}
}
}
SyndesisExtensionActionProcessor.java 文件源码
java
阅读 31
收藏 0
点赞 0
评论 0
项目:syndesis
作者:
评论列表
文章目录