public final class AnnotationValues
extends java.lang.Object
AnnotationValue instances.| Modifier and Type | Method and Description |
|---|---|
static com.google.common.collect.ImmutableList<javax.lang.model.element.AnnotationValue> |
getAnnotationValues(javax.lang.model.element.AnnotationValue annotationValue)
Returns the list of values represented by an array annotation value.
|
static javax.lang.model.element.VariableElement |
getEnum(javax.lang.model.element.AnnotationValue value)
Returns the value as a VariableElement.
|
static int[] |
getIntArrayValue(javax.lang.model.element.AnnotationMirror annotation,
java.lang.String valueName)
Returns the int array value of an annotation
|
static int |
getIntValue(javax.lang.model.element.AnnotationMirror annotation,
java.lang.String valueName)
Returns the int value of an annotation
|
static java.util.Optional<java.lang.Integer> |
getOptionalIntValue(javax.lang.model.element.AnnotationMirror annotation,
java.lang.String valueName)
Returns an optional int value of an annotation if the value name is present
|
static java.util.Optional<java.lang.String> |
getOptionalStringValue(javax.lang.model.element.AnnotationMirror annotation,
java.lang.String valueName)
Returns an optional String value of an annotation if the value name is present
|
static java.lang.String |
getString(javax.lang.model.element.AnnotationValue value)
Returns the value as a string.
|
static java.lang.String[] |
getStringArrayValue(javax.lang.model.element.AnnotationMirror annotation,
java.lang.String valueName)
Returns the String array value of an annotation
|
static java.lang.String |
getStringValue(javax.lang.model.element.AnnotationMirror annotation,
java.lang.String valueName)
Returns the String value of an annotation
|
static javax.lang.model.type.DeclaredType |
getTypeMirror(javax.lang.model.element.AnnotationValue value)
Returns the value as a class.
|
public static javax.lang.model.type.DeclaredType getTypeMirror(javax.lang.model.element.AnnotationValue value)
java.lang.IllegalArgumentException - if the value is not a class.public static javax.lang.model.element.VariableElement getEnum(javax.lang.model.element.AnnotationValue value)
java.lang.IllegalArgumentException - if the value is not an enum.public static java.lang.String getString(javax.lang.model.element.AnnotationValue value)
java.lang.IllegalArgumentException - if the value is not a string.public static int getIntValue(javax.lang.model.element.AnnotationMirror annotation,
java.lang.String valueName)
public static java.util.Optional<java.lang.Integer> getOptionalIntValue(javax.lang.model.element.AnnotationMirror annotation,
java.lang.String valueName)
public static java.lang.String getStringValue(javax.lang.model.element.AnnotationMirror annotation,
java.lang.String valueName)
public static java.util.Optional<java.lang.String> getOptionalStringValue(javax.lang.model.element.AnnotationMirror annotation,
java.lang.String valueName)
public static int[] getIntArrayValue(javax.lang.model.element.AnnotationMirror annotation,
java.lang.String valueName)
public static java.lang.String[] getStringArrayValue(javax.lang.model.element.AnnotationMirror annotation,
java.lang.String valueName)
public static com.google.common.collect.ImmutableList<javax.lang.model.element.AnnotationValue> getAnnotationValues(javax.lang.model.element.AnnotationValue annotationValue)
java.lang.IllegalArgumentException - unless annotationValue represents an array