public class AnnotationBuilder extends Object
Constructing an AnnotationMirror
requires:
setValue
methods
build()
to get the annotation
IllegalStateException
is thrown.
All setter methods throw IllegalArgumentException
if the specified element is not
found, or if the given value is not a subtype of the expected type.
TODO: Doesn't type-check arrays yet
Constructor and Description |
---|
AnnotationBuilder(ProcessingEnvironment env,
AnnotationMirror annotation) |
AnnotationBuilder(ProcessingEnvironment env,
CharSequence name) |
AnnotationBuilder(ProcessingEnvironment env,
Class<? extends Annotation> anno) |
public AnnotationBuilder(ProcessingEnvironment env, Class<? extends Annotation> anno)
public AnnotationBuilder(ProcessingEnvironment env, CharSequence name)
public AnnotationBuilder(ProcessingEnvironment env, AnnotationMirror annotation)
public AnnotationMirror build()
public AnnotationBuilder setValue(CharSequence elementName, AnnotationMirror value)
public AnnotationBuilder setValue(CharSequence elementName, List<? extends Object> values)
public AnnotationBuilder setValue(CharSequence elementName, Object[] values)
public AnnotationBuilder setValue(CharSequence elementName, Boolean value)
public AnnotationBuilder setValue(CharSequence elementName, Character value)
public AnnotationBuilder setValue(CharSequence elementName, Double value)
public AnnotationBuilder setValue(CharSequence elementName, Float value)
public AnnotationBuilder setValue(CharSequence elementName, Integer value)
public AnnotationBuilder setValue(CharSequence elementName, Long value)
public AnnotationBuilder setValue(CharSequence elementName, Short value)
public AnnotationBuilder setValue(CharSequence elementName, String value)
public AnnotationBuilder setValue(CharSequence elementName, TypeMirror value)
public AnnotationBuilder setValue(CharSequence elementName, Class<?> value)
public AnnotationBuilder setValue(CharSequence elementName, Enum<?> value)
public AnnotationBuilder setValue(CharSequence elementName, VariableElement value)
public AnnotationBuilder setValue(CharSequence elementName, Enum<?>[] values)
public AnnotationBuilder setValue(CharSequence elementName, VariableElement[] values)
public ExecutableElement findElement(CharSequence key)