public static Multimap<String, String> getAnnotationAsMap(org.jboss.forge.roaster.model.Annotation<?> annotation,
Class<? extends Annotation> type) {
if(annotation == null) return null;
List<Method> methods = getAnnotationAttributes(type);
Multimap<String, String> result = HashMultimap.create();
for (Method method : methods) {
String name = method.getName();
boolean array = method.getReturnType().isArray();
String value = annotation.getLiteralValue(name);
if(StringUtils.isBlank(value)) continue;
String [] values = array
? annotation.getStringArrayValue(name) : new String[]{annotation.getStringValue(name)};
if(allElementsNull(values)) continue;
result.putAll(name, Arrays.asList(values));
}
return result;
}
AnnotationUtils.java 文件源码
java
阅读 41
收藏 0
点赞 0
评论 0
项目:spring2ts
作者:
评论列表
文章目录