Пример #1
0
 @SuppressWarnings("unchecked")
 public Annotation hydrate(ClassLoader cl) {
   Class<Annotation> annCl = (Class<Annotation>) hydrateClass(annotationClass, cl);
   AnnotatedElement ae = annotatedItem.hydrate(cl);
   Annotation a = ae.getAnnotation(annCl);
   return a;
 }
Пример #2
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((annotatedItem == null) ? 0 : annotatedItem.hashCode());
   result = prime * result + ((annotationClass == null) ? 0 : annotationClass.hashCode());
   result = prime * result + ((annotationField == null) ? 0 : annotationField.hashCode());
   return result;
 }
Пример #3
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (obj == null) return false;
   if (getClass() != obj.getClass()) return false;
   AnnotationHandle other = (AnnotationHandle) obj;
   if (annotatedItem == null) {
     if (other.annotatedItem != null) return false;
   } else if (!annotatedItem.equals(other.annotatedItem)) return false;
   if (annotationClass == null) {
     if (other.annotationClass != null) return false;
   } else if (!annotationClass.equals(other.annotationClass)) return false;
   if (annotationField == null) {
     if (other.annotationField != null) return false;
   } else if (!annotationField.equals(other.annotationField)) return false;
   return true;
 }