mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-08-03 00:20:07 +07:00
Changed Context#getAnnotationMirror to use the annotation class argument
This commit is contained in:
@ -27,9 +27,17 @@ class Context {
|
||||
elementUtils = processingEnvironment.getElementUtils();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #getAnnotationMirror(Element, ClassName)} with cached value
|
||||
*/
|
||||
@Deprecated
|
||||
AnnotationMirror getAnnotationMirror(Element element, Class<? extends Annotation> annotationClass) {
|
||||
return getAnnotationMirror(element, ClassName.get(annotationClass));
|
||||
}
|
||||
|
||||
AnnotationMirror getAnnotationMirror(Element element, ClassName annotationClass) {
|
||||
for (AnnotationMirror annotationMirror : element.getAnnotationMirrors()) {
|
||||
if (Constants.PRIMARY_KEY.equals(ClassName.get(annotationMirror.getAnnotationType()))) {
|
||||
if (annotationClass.equals(ClassName.get(annotationMirror.getAnnotationType()))) {
|
||||
return annotationMirror;
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ class PrimaryKeyElement {
|
||||
primaryKeyElement = firstAcceptableElement;
|
||||
}
|
||||
|
||||
AnnotationMirror primaryKeyMirror = context.getAnnotationMirror(primaryKeyElement, PrimaryKey.class);
|
||||
AnnotationMirror primaryKeyMirror = context.getAnnotationMirror(primaryKeyElement, Constants.PRIMARY_KEY);
|
||||
return new PrimaryKeyElement(primaryKeyElement, primaryKeyMirror);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user