/** * Checks if the annotation matches the {@link MethodSensorAssignment}. * * @param methodSensorAssignment * {@link MethodSensorAssignment}. * @param methodType * method type to check * @return <code>true</code> if the method parameters matches the {@link MethodSensorAssignment} */ private boolean matchesAnnotation(MethodSensorAssignment methodSensorAssignment, ImmutableMethodType methodType) { // first check if annotation is defined at all if (StringUtils.isEmpty(methodSensorAssignment.getAnnotation())) { return true; } ImmutableTypeWithMethods type = methodType.getImmutableClassOrInterfaceType(); // Safety check for class type // it has to be class type if (!type.isClass()) { return false; } // check if class matches, if yes, then all methods match as well boolean classMatches = super.matchesAnnotation(methodSensorAssignment, type.castToClass()); if (classMatches) { return true; } IMatchPattern pattern = PatternFactory.getPattern(methodSensorAssignment.getAnnotation()); // if not check if the method has annotation return checkAnnotations(methodType.getImmutableAnnotations(), pattern); }