T - The element typeA - The annotation typepublic abstract class AbstractAnnotationMetadataBuilder<T,A> extends Object
AnnotationMetadata.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractAnnotationMetadataBuilder()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
AnnotationMetadata |
build(T element)
Build the meta data for the given element.
|
AnnotationMetadata |
buildForMethod(T element)
Build the meta data for the given method element excluding any class metadata.
|
AnnotationMetadata |
buildForParent(T parent,
T element)
Build the meta data for the given method element excluding any class metadata.
|
protected abstract List<T> |
buildHierarchy(T element,
boolean inheritTypeAnnotations)
Build the type hierarchy for the given element.
|
protected abstract VisitorContext |
createVisitorContext()
Creates the visitor context for this implementation.
|
protected abstract String |
getAnnotationMemberName(T member)
Read the name of an annotation member.
|
protected abstract Optional<T> |
getAnnotationMirror(String annotationName)
Return a mirror for the given annotation.
|
protected abstract List<? extends A> |
getAnnotationsForType(T element)
Obtain the annotations for the given type.
|
protected abstract String |
getAnnotationTypeName(A annotationMirror)
Get the given type of the annotation.
|
protected abstract OptionalValues<?> |
getAnnotationValues(T member,
Class<?> annotationType)
Resolve the annotations values from the given member for the given type.
|
protected abstract String |
getRepeatableName(A annotationMirror)
Obtain the name of the repeatable annotation if the annotation is is one.
|
protected abstract String |
getRepeatableNameForType(T annotationType)
Obtain the name of the repeatable annotation if the annotation is is one.
|
protected abstract T |
getTypeForAnnotation(A annotationMirror)
Get the type of the given annotation.
|
static boolean |
isAnnotationMapped(String annotationName)
Returns whether the given annotation is a mapped annotation.
|
protected Map<CharSequence,Object> |
populateAnnotationData(A annotationMirror,
DefaultAnnotationMetadata metadata,
boolean isDeclared)
Populate the annotation data for the given annotation.
|
protected abstract Map<? extends T,?> |
readAnnotationDefaultValues(A annotationMirror)
Read the raw default annotation values from the given annotation.
|
protected abstract Map<? extends T,?> |
readAnnotationDefaultValues(String annotationName,
T annotationType)
Read the raw default annotation values from the given annotation.
|
protected abstract Map<? extends T,?> |
readAnnotationRawValues(A annotationMirror)
Read the raw annotation values from the given annotation.
|
protected abstract void |
readAnnotationRawValues(String memberName,
Object annotationValue,
Map<CharSequence,Object> annotationValues)
Read the given member and value, applying conversions if necessary, and place the data in the given map.
|
protected abstract Object |
readAnnotationValue(String memberName,
Object annotationValue)
Read the given member and value, applying conversions if necessary, and place the data in the given map.
|
protected AnnotationValue |
readNestedAnnotationValue(A annotationMirror) |
protected AbstractAnnotationMetadataBuilder()
public AnnotationMetadata build(T element)
element - The elementAnnotationMetadatapublic AnnotationMetadata buildForMethod(T element)
element - The elementAnnotationMetadatapublic AnnotationMetadata buildForParent(T parent, T element)
parent - The parent elementelement - The elementAnnotationMetadataprotected abstract T getTypeForAnnotation(A annotationMirror)
annotationMirror - The annotationprotected abstract String getAnnotationTypeName(A annotationMirror)
annotationMirror - The annotationprotected abstract List<? extends A> getAnnotationsForType(T element)
element - The type elementprotected abstract List<T> buildHierarchy(T element, boolean inheritTypeAnnotations)
element - The elementinheritTypeAnnotations - Whether to inherit type annotationsprotected abstract void readAnnotationRawValues(String memberName, Object annotationValue, Map<CharSequence,Object> annotationValues)
memberName - The memberannotationValue - The valueannotationValues - The values to populateprotected abstract Object readAnnotationValue(String memberName, Object annotationValue)
memberName - The memberannotationValue - The valueprotected abstract Map<? extends T,?> readAnnotationDefaultValues(A annotationMirror)
annotationMirror - The annotationprotected abstract Map<? extends T,?> readAnnotationDefaultValues(String annotationName, T annotationType)
annotationName - annotation nameannotationType - the typeprotected abstract Map<? extends T,?> readAnnotationRawValues(A annotationMirror)
annotationMirror - The annotationprotected abstract OptionalValues<?> getAnnotationValues(T member, Class<?> annotationType)
member - The memberannotationType - The typeprotected abstract String getAnnotationMemberName(T member)
member - The member@Nullable protected abstract String getRepeatableName(A annotationMirror)
annotationMirror - The annotation mirror@Nullable protected abstract String getRepeatableNameForType(T annotationType)
annotationType - The annotation mirrorprotected AnnotationValue readNestedAnnotationValue(A annotationMirror)
annotationMirror - The annotationprotected abstract Optional<T> getAnnotationMirror(String annotationName)
annotationName - The annotation nameprotected Map<CharSequence,Object> populateAnnotationData(A annotationMirror, DefaultAnnotationMetadata metadata, boolean isDeclared)
annotationMirror - The annotationmetadata - the metadataisDeclared - Is the annotation a declared annotationprotected abstract VisitorContext createVisitorContext()