Commit 16e61698 authored by Daniel Bluhm's avatar Daniel Bluhm

More formatting fixes in AnnotatedElement

Signed-off-by: Daniel Bluhm's avatarDaniel Bluhm <bluhmdj@ornl.gov>
parent 2ebc20b8
......@@ -41,14 +41,14 @@ public class AnnotatedElement {
protected Elements elementUtils;
/**
* The element representing an interface annotated with {@code @DataElement}.
* The element representing an interface annotated with
* {@code @DataElement}.
*/
protected Element element;
/**
* Construct an AnnotatedElement from an Element.
*
* @param element The annotated element
* @param element The annotated element
* @param elementUtils Elements helper from processing environment
*/
public AnnotatedElement(Element element, Elements elementUtils) {
......@@ -87,9 +87,8 @@ public class AnnotatedElement {
* This is useful when dealing with a complicated Annotation potentially
* containing a value that is a Class object. Otherwise, it is recommended to
* directly retrieve the value from an Annotation instance.
*
* @param annotationClass the class of the annotation from which values will be
* retrieved.
* @param annotationClass the class of the annotation from which values
* will be retrieved.
* @return Map of String to unwrapped AnnotationValue (Object)
*/
public Map<String, Object> getAnnotationValueMap(Class<?> annotationClass) {
......@@ -111,14 +110,16 @@ public class AnnotatedElement {
* directly retrieve the value from an Annotation instance.
*
* @param annotationClass the class of the annotation from which values will be
* retrieved.
* retrieved.
* @return list of AnnotationValue
*/
public List<AnnotationValue> getAnnotationValues(Class<?> annotationClass) {
return this.getAnnotationMirror(annotationClass)
.map(mirror -> elementUtils.getElementValuesWithDefaults(mirror)).map(map -> map.entrySet().stream()
.map(entry -> (AnnotationValue) entry.getValue()).collect(Collectors.toList()))
.orElse(Collections.emptyList());
.map(mirror -> elementUtils.getElementValuesWithDefaults(mirror))
.map(map -> map.entrySet().stream()
.map(entry -> (AnnotationValue) entry.getValue())
.collect(Collectors.toList())
).orElse(Collections.emptyList());
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment