public class AnnotationValues<A extends java.lang.annotation.Annotation>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
AnnotationValues.AnnotationValue
Represents a single method on the annotation class.
|
static class |
AnnotationValues.AnnotationValueDecodeFail
Thrown on the fly if an actual annotation instance procured via the
getInstance() method is queried
for a method for which this AnnotationValues instance either doesn't have a guess or can't manage to fit
the guess into the required data type. |
Constructor and Description |
---|
AnnotationValues(java.lang.Class<A> type,
java.util.Map<java.lang.String,AnnotationValues.AnnotationValue> values,
LombokNode<?,?,?> ast)
Creates a new AnnotationValues.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getActualExpression(java.lang.String annotationMethodName)
Convenience method to return the first result in a
getActualExpressions(String) call. |
java.util.List<java.lang.Object> |
getActualExpressions(java.lang.String annotationMethodName)
Returns the actual expressions used for the provided
annotationMethodName . |
A |
getInstance()
Creates an actual annotation instance.
|
java.lang.String |
getProbableFQType(java.lang.String annotationMethodName)
Convenience method to return the first result in a
getProbableFQType(String) call. |
java.util.List<java.lang.String> |
getProbableFQTypes(java.lang.String annotationMethodName)
Attempts to translate class literals to their fully qualified names, such as 'Throwable.class' to 'java.lang.Throwable'.
|
java.lang.String |
getRawExpression(java.lang.String annotationMethodName)
Convenience method to return the first result in a
getRawExpressions(String) call. |
java.util.List<java.lang.String> |
getRawExpressions(java.lang.String annotationMethodName)
Returns the raw expressions used for the provided
annotationMethodName . |
boolean |
isExplicit(java.lang.String annotationMethodName) |
static <A extends java.lang.annotation.Annotation> |
of(java.lang.Class<A> type) |
static <A extends java.lang.annotation.Annotation> |
of(java.lang.Class<A> type,
LombokNode<?,?,?> ast)
Creates a new annotation wrapper with all default values, and using the provided ast as lookup anchor for
class literals.
|
void |
setError(java.lang.String annotationMethodName,
java.lang.String message)
Generates an error message on the stated annotation value (you should only call this method if you know it's there!)
|
void |
setError(java.lang.String annotationMethodName,
java.lang.String message,
int index)
Generates an error message on the stated annotation value, which must have an array initializer.
|
void |
setWarning(java.lang.String annotationMethodName,
java.lang.String message)
Generates a warning message on the stated annotation value (you should only call this method if you know it's there!)
|
void |
setWarning(java.lang.String annotationMethodName,
java.lang.String message,
int index)
Generates a warning message on the stated annotation value, which must have an array initializer.
|
public AnnotationValues(java.lang.Class<A> type, java.util.Map<java.lang.String,AnnotationValues.AnnotationValue> values, LombokNode<?,?,?> ast)
type
- The annotation type. For example, "Getter.class"values
- a Map of method names to AnnotationValue instances, for example 'value -> annotationValue instance'.ast
- The Annotation node.public static <A extends java.lang.annotation.Annotation> AnnotationValues<A> of(java.lang.Class<A> type)
public static <A extends java.lang.annotation.Annotation> AnnotationValues<A> of(java.lang.Class<A> type, LombokNode<?,?,?> ast)
public A getInstance()
public java.util.List<java.lang.String> getRawExpressions(java.lang.String annotationMethodName)
annotationMethodName
.
You should use this method for annotation methods that return Class
objects. Remember that
class literals end in ".class" which you probably want to strip off.public java.util.List<java.lang.Object> getActualExpressions(java.lang.String annotationMethodName)
annotationMethodName
.public boolean isExplicit(java.lang.String annotationMethodName)
public java.lang.String getRawExpression(java.lang.String annotationMethodName)
getRawExpressions(String)
call.
You should use this method if the annotation method is not an array type.public java.lang.Object getActualExpression(java.lang.String annotationMethodName)
getActualExpressions(String)
call.
You should use this method if the annotation method is not an array type.public void setError(java.lang.String annotationMethodName, java.lang.String message)
public void setWarning(java.lang.String annotationMethodName, java.lang.String message)
public void setError(java.lang.String annotationMethodName, java.lang.String message, int index)
public void setWarning(java.lang.String annotationMethodName, java.lang.String message, int index)
public java.util.List<java.lang.String> getProbableFQTypes(java.lang.String annotationMethodName)
public java.lang.String getProbableFQType(java.lang.String annotationMethodName)
getProbableFQType(String)
call.
You should use this method if the annotation method is not an array type.Copyright © 2009-2015 The Project Lombok Authors, licensed under the MIT licence.