/** * Search for the * {@link org.springframework.classify.annotation.Classifier * Classifier} annotation on a method in the supplied delegate and use that * to create a {@link Classifier} from the parameter type to the return * type. If the annotation is not found a unique non-void method with a * single parameter will be used, if it exists. The signature of the method * cannot be checked here, so might be a runtime exception when the method * is invoked if the signature doesn't match the classifier types. * * @param delegate an object with an annotated method */ public final void setDelegate(Object delegate) { classifier = null; invoker = MethodInvokerUtils.getMethodInvokerByAnnotation( org.springframework.classify.annotation.Classifier.class, delegate); if (invoker == null) { invoker = MethodInvokerUtils.<C, T> getMethodInvokerForSingleArgument(delegate); } Assert.state(invoker != null, "No single argument public method with or without " + "@Classifier was found in delegate of type " + delegate.getClass()); }
final Class<? extends Annotation> annotationType, final Object target, final Class<?>... expectedParamTypes) { MethodInvoker mi = MethodInvokerUtils.getMethodInvokerByAnnotation(annotationType, target); final Class<?> targetClass = (target instanceof Advised)
/** * Search for the * {@link org.springframework.classify.annotation.Classifier * Classifier} annotation on a method in the supplied delegate and use that * to create a {@link Classifier} from the parameter type to the return * type. If the annotation is not found a unique non-void method with a * single parameter will be used, if it exists. The signature of the method * cannot be checked here, so might be a runtime exception when the method * is invoked if the signature doesn't match the classifier types. * * @param delegate an object with an annotated method */ public final void setDelegate(Object delegate) { classifier = null; invoker = MethodInvokerUtils.getMethodInvokerByAnnotation( org.springframework.classify.annotation.Classifier.class, delegate); if (invoker == null) { invoker = MethodInvokerUtils.<C, T> getMethodInvokerForSingleArgument(delegate); } Assert.state(invoker != null, "No single argument public method with or without " + "@Classifier was found in delegate of type " + delegate.getClass()); }
final Class<? extends Annotation> annotationType, final Object target, final Class<?>... expectedParamTypes) { MethodInvoker mi = MethodInvokerUtils.getMethodInvokerByAnnotation(annotationType, target); final Class<?> targetClass = (target instanceof Advised)