public virtual Annotation getAnnotation(Class annotationType) { Iterator iterator = this.getAnnotations().iterator(); while (iterator.hasNext()) { Annotation annotation = (Annotation) iterator.next(); if (annotationType.isInstance((object) annotation)) return (Annotation) annotationType.cast((object) annotation); } return (Annotation) null; }
public virtual Annotation getAnnotation(Class annotationType) { Annotation[] annotationArray = this.fAnnotations; int length = annotationArray.Length; for (int index = 0; index < length; ++index) { Annotation annotation = annotationArray[index]; if (Object.instancehelper_equals((object) annotation.annotationType(), (object) annotationType)) return (Annotation) annotationType.cast((object) annotation); } return (Annotation) null; }
public virtual List getAnnotatedFieldValues(object test, Class annotationClass, Class valueClass) { ArrayList arrayList = new ArrayList(); Iterator iterator = this.getAnnotatedFields(annotationClass).iterator(); while (iterator.hasNext()) { FrameworkField frameworkField = (FrameworkField) iterator.next(); try { ((List) arrayList).add(valueClass.cast(frameworkField.get(test))); continue; } catch (IllegalAccessException ex) { } string str = "How did getFields return a field we couldn't access?"; Throwable.__\u003CsuppressFillInStackTrace\u003E(); throw new RuntimeException(str); } return (List) arrayList; }