checkers.util
Class AnnotationUtils.AnnotationBuilder
java.lang.Object
checkers.util.AnnotationUtils.AnnotationBuilder
- Enclosing class:
- AnnotationUtils
public static class AnnotationUtils.AnnotationBuilder
- extends Object
Builds an annotation mirror that may have some values.
Constructing an AnnotationMirror
requires:
1. Constructing the builder with the desired annotation class
2. Setting each value individually using SetValue
methods
3. Calling build()
to get the annotation build so far
Once an annotation is built, no further modification or calls to
build can be made. Otherwise, a IllegalStateException
.
All setter methods throw IllegalArgumentException
if the
specified element is not found, or that the given value is not a
subtype of the expected type.
TODO: Doesn't type check arrays yet
Method Summary |
AnnotationMirror |
build()
|
AnnotationUtils.AnnotationBuilder |
setValue(CharSequence elementName,
AnnotationMirror value)
|
AnnotationUtils.AnnotationBuilder |
setValue(CharSequence elementName,
Boolean value)
|
AnnotationUtils.AnnotationBuilder |
setValue(CharSequence elementName,
Character value)
|
AnnotationUtils.AnnotationBuilder |
setValue(CharSequence elementName,
Class<?> value)
|
AnnotationUtils.AnnotationBuilder |
setValue(CharSequence elementName,
Double value)
|
AnnotationUtils.AnnotationBuilder |
setValue(CharSequence elementName,
Enum<?> value)
|
AnnotationUtils.AnnotationBuilder |
setValue(CharSequence elementName,
Float value)
|
AnnotationUtils.AnnotationBuilder |
setValue(CharSequence elementName,
Integer value)
|
AnnotationUtils.AnnotationBuilder |
setValue(CharSequence elementName,
List<? extends Object> values)
|
AnnotationUtils.AnnotationBuilder |
setValue(CharSequence elementName,
Long value)
|
AnnotationUtils.AnnotationBuilder |
setValue(CharSequence elementName,
Object[] values)
|
AnnotationUtils.AnnotationBuilder |
setValue(CharSequence elementName,
Short value)
|
AnnotationUtils.AnnotationBuilder |
setValue(CharSequence elementName,
String value)
|
AnnotationUtils.AnnotationBuilder |
setValue(CharSequence elementName,
TypeMirror value)
|
AnnotationUtils.AnnotationBuilder |
setValue(CharSequence elementName,
VariableElement value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AnnotationUtils.AnnotationBuilder
public AnnotationUtils.AnnotationBuilder(ProcessingEnvironment env,
Class<? extends Annotation> anno)
AnnotationUtils.AnnotationBuilder
public AnnotationUtils.AnnotationBuilder(ProcessingEnvironment env,
CharSequence name)
AnnotationUtils.AnnotationBuilder
public AnnotationUtils.AnnotationBuilder(ProcessingEnvironment env,
AnnotationMirror annotation)
build
public AnnotationMirror build()
setValue
public AnnotationUtils.AnnotationBuilder setValue(CharSequence elementName,
AnnotationMirror value)
setValue
public AnnotationUtils.AnnotationBuilder setValue(CharSequence elementName,
List<? extends Object> values)
setValue
public AnnotationUtils.AnnotationBuilder setValue(CharSequence elementName,
Object[] values)
setValue
public AnnotationUtils.AnnotationBuilder setValue(CharSequence elementName,
Boolean value)
setValue
public AnnotationUtils.AnnotationBuilder setValue(CharSequence elementName,
Character value)
setValue
public AnnotationUtils.AnnotationBuilder setValue(CharSequence elementName,
Double value)
setValue
public AnnotationUtils.AnnotationBuilder setValue(CharSequence elementName,
VariableElement value)
setValue
public AnnotationUtils.AnnotationBuilder setValue(CharSequence elementName,
Float value)
setValue
public AnnotationUtils.AnnotationBuilder setValue(CharSequence elementName,
Integer value)
setValue
public AnnotationUtils.AnnotationBuilder setValue(CharSequence elementName,
Long value)
setValue
public AnnotationUtils.AnnotationBuilder setValue(CharSequence elementName,
Short value)
setValue
public AnnotationUtils.AnnotationBuilder setValue(CharSequence elementName,
String value)
setValue
public AnnotationUtils.AnnotationBuilder setValue(CharSequence elementName,
TypeMirror value)
setValue
public AnnotationUtils.AnnotationBuilder setValue(CharSequence elementName,
Class<?> value)
setValue
public AnnotationUtils.AnnotationBuilder setValue(CharSequence elementName,
Enum<?> value)