public class AnnotationValues<A extends Annotation> extends 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(Class<A> type,
Map<String,AnnotationValues.AnnotationValue> values,
LombokNode<?,?,?> ast)
Creates a new AnnotationValues.
|
Modifier and Type | Method and Description |
---|---|
Object |
getActualExpression(String annotationMethodName)
Convenience method to return the first result in a
getActualExpressions(String) call. |
List<Object> |
getActualExpressions(String annotationMethodName)
Returns the actual expressions used for the provided
annotationMethodName . |
A |
getInstance()
Creates an actual annotation instance.
|
String |
getProbableFQType(String annotationMethodName)
Convenience method to return the first result in a
getProbableFQType(String) call. |
List<String> |
getProbableFQTypes(String annotationMethodName)
Attempts to translate class literals to their fully qualified names, such as 'Throwable.class' to 'java.lang.Throwable'.
|
String |
getRawExpression(String annotationMethodName)
Convenience method to return the first result in a
getRawExpressions(String) call. |
List<String> |
getRawExpressions(String annotationMethodName)
Returns the raw expressions used for the provided
annotationMethodName . |
boolean |
isExplicit(String annotationMethodName) |
static <A extends Annotation> |
of(Class<A> type) |
static <A extends Annotation> |
of(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(String annotationMethodName,
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(String annotationMethodName,
String message,
int index)
Generates an error message on the stated annotation value, which must have an array initializer.
|
void |
setWarning(String annotationMethodName,
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(String annotationMethodName,
String message,
int index)
Generates a warning message on the stated annotation value, which must have an array initializer.
|
public AnnotationValues(Class<A> type, Map<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 Annotation> AnnotationValues<A> of(Class<A> type)
public static <A extends Annotation> AnnotationValues<A> of(Class<A> type, LombokNode<?,?,?> ast)
public A getInstance()
public List<String> getRawExpressions(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 List<Object> getActualExpressions(String annotationMethodName)
annotationMethodName
.public boolean isExplicit(String annotationMethodName)
public String getRawExpression(String annotationMethodName)
getRawExpressions(String)
call.
You should use this method if the annotation method is not an array type.public Object getActualExpression(String annotationMethodName)
getActualExpressions(String)
call.
You should use this method if the annotation method is not an array type.public void setError(String annotationMethodName, String message)
public void setWarning(String annotationMethodName, String message)
public void setError(String annotationMethodName, String message, int index)
public void setWarning(String annotationMethodName, String message, int index)
public List<String> getProbableFQTypes(String annotationMethodName)
public String getProbableFQType(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.