private static boolean isValidBusinessMethodInterceptorMethod(InterceptionType interceptionType, Method method) { if (!Object.class.equals(method.getReturnType())) { throw ValidatorLogger.LOG.interceptorMethodDoesNotReturnObject(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), OBJECT_CLASS_NAME, Formats.formatAsStackTraceElement(method)); } Class<?>[] parameterTypes = method.getParameterTypes(); if (parameterTypes.length != 1) { throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveExactlyOneParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), Formats.formatAsStackTraceElement(method)); } if (!InvocationContext.class.isAssignableFrom(parameterTypes[0])) { throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveCorrectTypeOfParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), InvocationContext.class.getName(), Formats.formatAsStackTraceElement(method)); } return true; }
private static boolean isValidBusinessMethodInterceptorMethod(InterceptionType interceptionType, Method method) { if (!Object.class.equals(method.getReturnType())) { throw ValidatorLogger.LOG.interceptorMethodDoesNotReturnObject(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), OBJECT_CLASS_NAME, Formats.formatAsStackTraceElement(method)); } Class<?>[] parameterTypes = method.getParameterTypes(); if (parameterTypes.length != 1) { throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveExactlyOneParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), Formats.formatAsStackTraceElement(method)); } if (!InvocationContext.class.isAssignableFrom(parameterTypes[0])) { throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveCorrectTypeOfParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), InvocationContext.class.getName(), Formats.formatAsStackTraceElement(method)); } return true; }
private static boolean isValidBusinessMethodInterceptorMethod(InterceptionType interceptionType, Method method) { if (!Object.class.equals(method.getReturnType())) { throw ValidatorLogger.LOG.interceptorMethodDoesNotReturnObject(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), OBJECT_CLASS_NAME, Formats.formatAsStackTraceElement(method)); } Class<?>[] parameterTypes = method.getParameterTypes(); if (parameterTypes.length != 1) { throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveExactlyOneParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), Formats.formatAsStackTraceElement(method)); } if (!InvocationContext.class.isAssignableFrom(parameterTypes[0])) { throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveCorrectTypeOfParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), InvocationContext.class.getName(), Formats.formatAsStackTraceElement(method)); } return true; }
private static boolean isValidBusinessMethodInterceptorMethod(InterceptionType interceptionType, Method method) { if (!Object.class.equals(method.getReturnType())) { throw ValidatorLogger.LOG.interceptorMethodDoesNotReturnObject(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), OBJECT_CLASS_NAME, Formats.formatAsStackTraceElement(method)); } Class<?>[] parameterTypes = method.getParameterTypes(); if (parameterTypes.length != 1) { throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveExactlyOneParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), Formats.formatAsStackTraceElement(method)); } if (!InvocationContext.class.isAssignableFrom(parameterTypes[0])) { throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveCorrectTypeOfParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), InvocationContext.class.getName(), Formats.formatAsStackTraceElement(method)); } return true; }
private static boolean isValidInterceptorClassLifecycleInterceptorMethod(InterceptionType interceptionType, Method method) { if (!Object.class.equals(method.getReturnType()) && !Void.TYPE.equals(method.getReturnType())) { throw ValidatorLogger.LOG.interceptorMethodDoesNotReturnObjectOrVoid(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), Void.TYPE.getName(), OBJECT_CLASS_NAME, Formats.formatAsStackTraceElement(method)); } Class<?>[] parameterTypes = method.getParameterTypes(); if (parameterTypes.length == 0) { return false; } else if (parameterTypes.length == 1) { if (InvocationContext.class.isAssignableFrom(parameterTypes[0])) { return true; } throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveCorrectTypeOfParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), InvocationContext.class.getName(), Formats.formatAsStackTraceElement(method)); } else { throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveExactlyOneParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), Formats.formatAsStackTraceElement(method)); } }
private static boolean isValidInterceptorClassLifecycleInterceptorMethod(InterceptionType interceptionType, Method method) { if (!Object.class.equals(method.getReturnType()) && !Void.TYPE.equals(method.getReturnType())) { throw ValidatorLogger.LOG.interceptorMethodDoesNotReturnObjectOrVoid(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), Void.TYPE.getName(), OBJECT_CLASS_NAME, Formats.formatAsStackTraceElement(method)); } Class<?>[] parameterTypes = method.getParameterTypes(); if (parameterTypes.length == 0) { return false; } else if (parameterTypes.length == 1) { if (InvocationContext.class.isAssignableFrom(parameterTypes[0])) { return true; } throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveCorrectTypeOfParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), InvocationContext.class.getName(), Formats.formatAsStackTraceElement(method)); } else { throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveExactlyOneParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), Formats.formatAsStackTraceElement(method)); } }
private static boolean isValidInterceptorClassLifecycleInterceptorMethod(InterceptionType interceptionType, Method method) { if (!Object.class.equals(method.getReturnType()) && !Void.TYPE.equals(method.getReturnType())) { throw ValidatorLogger.LOG.interceptorMethodDoesNotReturnObjectOrVoid(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), Void.TYPE.getName(), OBJECT_CLASS_NAME, Formats.formatAsStackTraceElement(method)); } Class<?>[] parameterTypes = method.getParameterTypes(); if (parameterTypes.length == 0) { return false; } else if (parameterTypes.length == 1) { if (InvocationContext.class.isAssignableFrom(parameterTypes[0])) { return true; } throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveCorrectTypeOfParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), InvocationContext.class.getName(), Formats.formatAsStackTraceElement(method)); } else { throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveExactlyOneParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), Formats.formatAsStackTraceElement(method)); } }
private static boolean isValidBusinessMethodInterceptorMethod(InterceptionType interceptionType, Method method) { if (!Object.class.equals(method.getReturnType())) { throw ValidatorLogger.LOG.interceptorMethodDoesNotReturnObject(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), OBJECT_CLASS_NAME, Formats.formatAsStackTraceElement(method)); } Class<?>[] parameterTypes = method.getParameterTypes(); if (parameterTypes.length != 1) { throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveExactlyOneParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), Formats.formatAsStackTraceElement(method)); } if (!InvocationContext.class.isAssignableFrom(parameterTypes[0])) { throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveCorrectTypeOfParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), InvocationContext.class.getName(), Formats.formatAsStackTraceElement(method)); } return true; }
private static boolean isValidInterceptorClassLifecycleInterceptorMethod(InterceptionType interceptionType, Method method) { if (!Object.class.equals(method.getReturnType()) && !Void.TYPE.equals(method.getReturnType())) { throw ValidatorLogger.LOG.interceptorMethodDoesNotReturnObjectOrVoid(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), Void.TYPE.getName(), OBJECT_CLASS_NAME, Formats.formatAsStackTraceElement(method)); } Class<?>[] parameterTypes = method.getParameterTypes(); if (parameterTypes.length == 0) { return false; } else if (parameterTypes.length == 1) { if (InvocationContext.class.isAssignableFrom(parameterTypes[0])) { return true; } throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveCorrectTypeOfParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), InvocationContext.class.getName(), Formats.formatAsStackTraceElement(method)); } else { throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveExactlyOneParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), Formats.formatAsStackTraceElement(method)); } }
private static boolean isValidBusinessMethodInterceptorMethod(InterceptionType interceptionType, Method method) { if (!Object.class.equals(method.getReturnType())) { throw ValidatorLogger.LOG.interceptorMethodDoesNotReturnObject(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), OBJECT_CLASS_NAME, Formats.formatAsStackTraceElement(method)); } Class<?>[] parameterTypes = method.getParameterTypes(); if (parameterTypes.length != 1) { throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveExactlyOneParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), Formats.formatAsStackTraceElement(method)); } if (!InvocationContext.class.isAssignableFrom(parameterTypes[0])) { throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveCorrectTypeOfParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), InvocationContext.class.getName(), Formats.formatAsStackTraceElement(method)); } return true; }
private static boolean isValidInterceptorClassLifecycleInterceptorMethod(InterceptionType interceptionType, Method method) { if (!Object.class.equals(method.getReturnType()) && !Void.TYPE.equals(method.getReturnType())) { throw ValidatorLogger.LOG.interceptorMethodDoesNotReturnObjectOrVoid(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), Void.TYPE.getName(), OBJECT_CLASS_NAME, Formats.formatAsStackTraceElement(method)); } Class<?>[] parameterTypes = method.getParameterTypes(); if (parameterTypes.length == 0) { return false; } else if (parameterTypes.length == 1) { if (InvocationContext.class.isAssignableFrom(parameterTypes[0])) { return true; } throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveCorrectTypeOfParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), InvocationContext.class.getName(), Formats.formatAsStackTraceElement(method)); } else { throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveExactlyOneParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), Formats.formatAsStackTraceElement(method)); } }
private static boolean isValidInterceptorClassLifecycleInterceptorMethod(InterceptionType interceptionType, Method method) { if (!Object.class.equals(method.getReturnType()) && !Void.TYPE.equals(method.getReturnType())) { throw ValidatorLogger.LOG.interceptorMethodDoesNotReturnObjectOrVoid(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), Void.TYPE.getName(), OBJECT_CLASS_NAME, Formats.formatAsStackTraceElement(method)); } Class<?>[] parameterTypes = method.getParameterTypes(); if (parameterTypes.length == 0) { return false; } else if (parameterTypes.length == 1) { if (InvocationContext.class.isAssignableFrom(parameterTypes[0])) { return true; } throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveCorrectTypeOfParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), InvocationContext.class.getName(), Formats.formatAsStackTraceElement(method)); } else { throw ValidatorLogger.LOG.interceptorMethodDoesNotHaveExactlyOneParameter(method.getName(), method.getDeclaringClass().getName(), interceptionType.annotationClassName(), Formats.formatAsStackTraceElement(method)); } }