Class SameAnnotationValueVisitor
- All Implemented Interfaces:
AnnotationValueVisitor<Boolean,Object>
AbstractAnnotationValueVisitor14 that determines if the otherwise opaque values represented by two AnnotationValue implementations are to be considered the
same.
This class implements the rules described by the Annotation.equals(Object) contract,
for want of a more authoritative source. This contract appears to define in a mostly agnostic manner what it means
for two annotations to be "the same".
Unlike some other annotation-processing-related facilities, the relation represented by this SameAnnotationValueVisitor does not require that the values being logically compared originate from AnnotationValue instances from the same vendor or toolkit.
The second argument passed to AbstractAnnotationValueVisitor6.visit(AnnotationValue, Object) is expected to be either null, an
AnnotationValue, or the result of an invocation of an AnnotationValue's getValue() method.
Any two TypeElements encountered during traversal are considered equal if their qualified names have equal contents.
Any two VariableElements representing enum constants encountered during traversal are considered equal if
they belong to the same enum class and their simple names have
equal contents.
- Author:
- Laird Nelson
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newSameAnnotationValueVisitor.SameAnnotationValueVisitor(Predicate<? super ExecutableElement> p) Creates a newSameAnnotationValueVisitor. -
Method Summary
Modifier and TypeMethodDescriptionfinal BooleanvisitAnnotation(AnnotationMirror am0, Object v1) final BooleanvisitArray(List<? extends AnnotationValue> l0, Object v1) final BooleanvisitBoolean(boolean b0, Object v1) final Booleanfinal Booleanfinal BooleanvisitDouble(double d0, Object v1) final BooleanvisitEnumConstant(VariableElement ve0, Object v1) final BooleanvisitFloat(float f0, Object v1) final Booleanfinal Booleanfinal BooleanvisitShort(short s0, Object v1) final BooleanvisitString(String s0, Object v1) final BooleanvisitType(TypeMirror t0, Object v1) Methods inherited from class AbstractAnnotationValueVisitor6
visit, visit, visitUnknown
-
Constructor Details
-
SameAnnotationValueVisitor
-
SameAnnotationValueVisitor
Creates a newSameAnnotationValueVisitor.- Parameters:
p- aPredicatethat returnstrueif a givenExecutableElement, representing an annotation interface element, is to be included in the computation; may benullin which case it is as if()-> truewere supplied instead
-
-
Method Details
-
visitAnnotation
-
visitArray
-
visitBoolean
-
visitByte
-
visitChar
-
visitDouble
-
visitEnumConstant
-
visitFloat
-
visitInt
-
visitLong
-
visitShort
-
visitString
-
visitType
-