public final class AnnotationHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> List<T> |
extractList(CompileEnvironment environment,
Class<T> componentValueType,
List<? extends AnnotationValue> values)
Extracts component values in the target list.
|
static AnnotationMirror |
findAnnotation(CompileEnvironment environment,
TypeElement annotationDecl,
Element element)
Returns the annotation presented in the target element.
|
static AnnotationValue |
getValue(CompileEnvironment environment,
AnnotationMirror annotation,
String name)
Returns the value of annotation member.
|
static Map<String,AnnotationValue> |
getValues(CompileEnvironment environment,
AnnotationMirror annotation)
Returns the name-value pairs in annotation.
|
static List<AnnotationValue> |
toValueList(CompileEnvironment environment,
AnnotationValue value)
Converts the value into component list.
|
public static AnnotationMirror findAnnotation(CompileEnvironment environment, TypeElement annotationDecl, Element element)
environment - current environmentannotationDecl - target annotation type elementelement - target annotated elementnull if does not presentIllegalArgumentException - if some parameters were nullpublic static Map<String,AnnotationValue> getValues(CompileEnvironment environment, AnnotationMirror annotation)
environment - current environmentannotation - target annotationIllegalArgumentException - if some parameters were nullpublic static AnnotationValue getValue(CompileEnvironment environment, AnnotationMirror annotation, String name)
environment - current environmentannotation - target annotationname - target annotation member namenull if the member is not declaredIllegalArgumentException - if some parameters were nullpublic static List<AnnotationValue> toValueList(CompileEnvironment environment, AnnotationValue value)
environment - current environmentvalue - target annotation valueIllegalArgumentException - if some parameters were nullpublic static <T> List<T> extractList(CompileEnvironment environment, Class<T> componentValueType, List<? extends AnnotationValue> values)
T - component value typeenvironment - current environmentcomponentValueType - target value type, the returning list only includes values with this typevalues - target annotation valuesIllegalArgumentException - if some parameters were nullCopyright © 2011–2018 Asakusa Framework Team. All rights reserved.