/** * {@inheritDoc} */ @SuppressWarnings("unchecked") public <T extends Annotation> AnnotationDescription.Loadable<T> ofType(Class<T> annotationType) { for (AnnotationDescription annotation : this) { if (annotation.getAnnotationType().represents(annotationType)) { return annotation.prepare(annotationType); } } return (AnnotationDescription.Loadable<T>) AnnotationDescription.UNDEFINED; }
/** * Creates a handler for a given annotation. * * @param target The target parameter being handled. * @param parameterBinder The parameter binder that should process an annotation. * @param annotation An annotation instance that can be understood by this parameter binder. * @param typing The typing to apply. * @return A handler for processing the given annotation. */ @SuppressWarnings("unchecked") protected static Handler of(ParameterDescription target, ParameterBinder<?> parameterBinder, AnnotationDescription annotation, Assigner.Typing typing) { return new Bound<Annotation>(target, (ParameterBinder<Annotation>) parameterBinder, (AnnotationDescription.Loadable<Annotation>) annotation.prepare(parameterBinder.getHandledType()), typing); }
/** * {@inheritDoc} */ public AnnotationValue.Loaded<U> load(ClassLoader classLoader) throws ClassNotFoundException { @SuppressWarnings("unchecked") Class<U> annotationType = (Class<U>) Class.forName(annotationDescription.getAnnotationType().getName(), false, classLoader); return new Loaded<U>(annotationDescription.prepare(annotationType).load()); }
@SuppressWarnings("unchecked") OffsetMapping current = factory.make(parameterDescription, (AnnotationDescription.Loadable) annotationDescription.prepare(factory.getAnnotationType()), adviceType); if (offsetMapping == null) {