final Annotation[][] parameterAnnotations = am.getParameterAnnotations(); final Class<?>[] parameterTypes = am.getParameterTypes(); final Type[] parameterGenericTypes = am.getGenericParameterTypes();
/** * Create a list of parameter models for a given Java method handling a resource * method, sub-resource method or a sub-resource locator. * * @param concreteClass concrete resource method handler implementation class. * @param declaringClass the class declaring the handling Java method. * @param javaMethod Java method handling a resource method, sub-resource * method or a sub-resource locator. * @param keepEncoded set to {@code true} to disable automatic decoding * of all the method parameters. (See {@link Encoded}. * @return a list of handling method parameter models. */ public static List<Parameter> create( Class concreteClass, Class declaringClass, Method javaMethod, boolean keepEncoded) { AnnotatedMethod method = new AnnotatedMethod(javaMethod); return create( concreteClass, declaringClass, ((null != method.getAnnotation(Encoded.class)) || keepEncoded), method.getParameterTypes(), method.getGenericParameterTypes(), method.getParameterAnnotations()); }
/** * Create a list of parameter models for a given Java method handling a resource * method, sub-resource method or a sub-resource locator. * * @param concreteClass concrete resource method handler implementation class. * @param declaringClass the class declaring the handling Java method. * @param javaMethod Java method handling a resource method, sub-resource * method or a sub-resource locator. * @param keepEncoded set to {@code true} to disable automatic decoding * of all the method parameters. (See {@link Encoded}. * @return a list of handling method parameter models. */ public static List<Parameter> create( Class concreteClass, Class declaringClass, Method javaMethod, boolean keepEncoded) { AnnotatedMethod method = new AnnotatedMethod(javaMethod); return create( concreteClass, declaringClass, ((null != method.getAnnotation(Encoded.class)) || keepEncoded), method.getParameterTypes(), method.getGenericParameterTypes(), method.getParameterAnnotations()); }
private void checkResourceClassSetters(final MethodList methodList, final boolean encodedFlag, Collection<Parameter> injectableParameters) { for (AnnotatedMethod method : methodList.withoutMetaAnnotation(HttpMethod.class) .withoutAnnotation(Path.class) .hasNumParams(1) .hasReturnType(void.class) .nameStartsWith("set")) { Parameter p = Parameter.create( handlerClass, method.getMethod().getDeclaringClass(), encodedFlag || method.isAnnotationPresent(Encoded.class), method.getParameterTypes()[0], method.getGenericParameterTypes()[0], method.getAnnotations()); if (null != p) { ResourceMethodValidator.validateParameter(p, method.getMethod(), method.getMethod().toGenericString(), "1", InvocableValidator.isSingleton(handlerClass)); // we do not inject entity parameters into class instance fields and properties. if (p.getSource() != Parameter.Source.ENTITY) { injectableParameters.add(p); } } } }
private void checkResourceClassSetters(final MethodList methodList, final boolean encodedFlag, Collection<Parameter> injectableParameters) { for (AnnotatedMethod method : methodList.withoutMetaAnnotation(HttpMethod.class) .withoutAnnotation(Path.class) .hasNumParams(1) .hasReturnType(void.class) .nameStartsWith("set")) { Parameter p = Parameter.create( handlerClass, method.getMethod().getDeclaringClass(), encodedFlag || method.isAnnotationPresent(Encoded.class), method.getParameterTypes()[0], method.getGenericParameterTypes()[0], method.getAnnotations()); if (null != p) { ResourceMethodValidator.validateParameter(p, method.getMethod(), method.getMethod().toGenericString(), "1", InvocableValidator.isSingleton(handlerClass)); // we do not inject entity parameters into class instance fields and properties. if (p.getSource() != Parameter.Source.ENTITY) { injectableParameters.add(p); } } } }
/** * Create a list of parameter models for a given Java method handling a resource * method, sub-resource method or a sub-resource locator. * * @param concreteClass concrete resource method handler implementation class. * @param declaringClass the class declaring the handling Java method. * @param javaMethod Java method handling a resource method, sub-resource * method or a sub-resource locator. * @param keepEncoded set to {@code true} to disable automatic decoding * of all the method parameters. (See {@link Encoded}. * @return a list of handling method parameter models. */ public static List<Parameter> create( Class concreteClass, Class declaringClass, Method javaMethod, boolean keepEncoded) { AnnotatedMethod method = new AnnotatedMethod(javaMethod); return create( concreteClass, declaringClass, ((null != method.getAnnotation(Encoded.class)) || keepEncoded), method.getParameterTypes(), method.getGenericParameterTypes(), method.getParameterAnnotations()); }
private void checkResourceClassSetters(final MethodList methodList, final boolean encodedFlag, Collection<Parameter> injectableParameters) { for (AnnotatedMethod method : methodList.withoutMetaAnnotation(HttpMethod.class) .withoutAnnotation(Path.class) .hasNumParams(1) .hasReturnType(void.class) .nameStartsWith("set")) { Parameter p = Parameter.create( handlerClass, method.getMethod().getDeclaringClass(), encodedFlag || method.isAnnotationPresent(Encoded.class), method.getParameterTypes()[0], method.getGenericParameterTypes()[0], method.getAnnotations()); if (null != p) { ResourceMethodValidator.validateParameter(p, method.getMethod(), method.getMethod().toGenericString(), "1", InvocableValidator.isSingleton(handlerClass)); // we do not inject entity parameters into class instance fields and properties. if (p.getSource() != Parameter.Source.ENTITY) { injectableParameters.add(p); } } } }
final Annotation[][] parameterAnnotations = am.getParameterAnnotations(); final Class<?>[] parameterTypes = am.getParameterTypes(); final Type[] parameterGenericTypes = am.getGenericParameterTypes();
/** * Create a list of parameter models for a given Java method handling a resource * method, sub-resource method or a sub-resource locator. * * @param concreteClass concrete resource method handler implementation class. * @param declaringClass the class declaring the handling Java method. * @param javaMethod Java method handling a resource method, sub-resource * method or a sub-resource locator. * @param keepEncoded set to {@code true} to disable automatic decoding * of all the method parameters. (See {@link Encoded}. * @return a list of handling method parameter models. */ public static List<Parameter> create( Class concreteClass, Class declaringClass, Method javaMethod, boolean keepEncoded) { AnnotatedMethod method = new AnnotatedMethod(javaMethod); return create( concreteClass, declaringClass, ((null != method.getAnnotation(Encoded.class)) || keepEncoded), method.getParameterTypes(), method.getGenericParameterTypes(), method.getParameterAnnotations()); }
/** * Create a list of parameter models for a given Java method handling a resource * method, sub-resource method or a sub-resource locator. * * @param concreteClass concrete resource method handler implementation class. * @param declaringClass the class declaring the handling Java method. * @param javaMethod Java method handling a resource method, sub-resource * method or a sub-resource locator. * @param keepEncoded set to {@code true} to disable automatic decoding * of all the method parameters. (See {@link Encoded}. * @return a list of handling method parameter models. */ public static List<Parameter> create( Class concreteClass, Class declaringClass, Method javaMethod, boolean keepEncoded) { AnnotatedMethod method = new AnnotatedMethod(javaMethod); return create( concreteClass, declaringClass, ((null != method.getAnnotation(Encoded.class)) || keepEncoded), method.getParameterTypes(), method.getGenericParameterTypes(), method.getParameterAnnotations()); }
/** * Create a list of parameter models for a given Java method handling a resource * method, sub-resource method or a sub-resource locator. * * @param concreteClass concrete resource method handler implementation class. * @param declaringClass the class declaring the handling Java method. * @param javaMethod Java method handling a resource method, sub-resource * method or a sub-resource locator. * @param keepEncoded set to {@code true} to disable automatic decoding * of all the method parameters. (See {@link Encoded}. * @return a list of handling method parameter models. */ public static List<Parameter> create( Class concreteClass, Class declaringClass, Method javaMethod, boolean keepEncoded) { AnnotatedMethod method = new AnnotatedMethod(javaMethod); return create( concreteClass, declaringClass, ((null != method.getAnnotation(Encoded.class)) || keepEncoded), method.getParameterTypes(), method.getGenericParameterTypes(), method.getParameterAnnotations()); }
/** * Create a list of parameter models for a given Java method handling a resource * method, sub-resource method or a sub-resource locator. * * @param concreteClass concrete resource method handler implementation class. * @param declaringClass the class declaring the handling Java method. * @param javaMethod Java method handling a resource method, sub-resource * method or a sub-resource locator. * @param keepEncoded set to {@code true} to disable automatic decoding * of all the method parameters. (See {@link Encoded}. * @return a list of handling method parameter models. */ public static List<Parameter> create( Class concreteClass, Class declaringClass, Method javaMethod, boolean keepEncoded) { AnnotatedMethod method = new AnnotatedMethod(javaMethod); return create( concreteClass, declaringClass, ((null != method.getAnnotation(Encoded.class)) || keepEncoded), method.getParameterTypes(), method.getGenericParameterTypes(), method.getParameterAnnotations()); }
private void checkResourceClassSetters(final MethodList methodList, final boolean encodedFlag, Collection<Parameter> injectableParameters) { for (AnnotatedMethod method : methodList.withoutMetaAnnotation(HttpMethod.class) .withoutAnnotation(Path.class) .hasNumParams(1) .hasReturnType(void.class) .nameStartsWith("set")) { Parameter p = Parameter.create( handlerClass, method.getMethod().getDeclaringClass(), encodedFlag || method.isAnnotationPresent(Encoded.class), method.getParameterTypes()[0], method.getGenericParameterTypes()[0], method.getAnnotations()); if (null != p) { ResourceMethodValidator.validateParameter(p, method.getMethod(), method.getMethod().toGenericString(), "1", InvocableValidator.isSingleton(handlerClass)); // we do not inject entity parameters into class instance fields and properties. if (p.getSource() != Parameter.Source.ENTITY) { injectableParameters.add(p); } } } }
private void checkResourceClassSetters(final MethodList methodList, final boolean encodedFlag, Collection<Parameter> injectableParameters) { for (AnnotatedMethod method : methodList.withoutMetaAnnotation(HttpMethod.class) .withoutAnnotation(Path.class) .hasNumParams(1) .hasReturnType(void.class) .nameStartsWith("set")) { Parameter p = Parameter.create( handlerClass, method.getMethod().getDeclaringClass(), encodedFlag || method.isAnnotationPresent(Encoded.class), method.getParameterTypes()[0], method.getGenericParameterTypes()[0], method.getAnnotations()); if (null != p) { ResourceMethodValidator.validateParameter(p, method.getMethod(), method.getMethod().toGenericString(), "1", InvocableValidator.isSingleton(handlerClass)); // we do not inject entity parameters into class instance fields and properties. if (p.getSource() != Parameter.Source.ENTITY) { injectableParameters.add(p); } } } }
private void checkResourceClassSetters(final MethodList methodList, final boolean encodedFlag, Collection<Parameter> injectableParameters) { for (AnnotatedMethod method : methodList.withoutMetaAnnotation(HttpMethod.class) .withoutAnnotation(Path.class) .hasNumParams(1) .hasReturnType(void.class) .nameStartsWith("set")) { Parameter p = Parameter.create( handlerClass, method.getMethod().getDeclaringClass(), encodedFlag || method.isAnnotationPresent(Encoded.class), method.getParameterTypes()[0], method.getGenericParameterTypes()[0], method.getAnnotations()); if (null != p) { ResourceMethodValidator.validateParameter(p, method.getMethod(), method.getMethod().toGenericString(), "1", InvocableValidator.isSingleton(handlerClass)); // we do not inject entity parameters into class instance fields and properties. if (p.getSource() != Parameter.Source.ENTITY) { injectableParameters.add(p); } } } }
private void checkResourceClassSetters(final MethodList methodList, final boolean encodedFlag, Collection<Parameter> injectableParameters) { for (AnnotatedMethod method : methodList.withoutMetaAnnotation(HttpMethod.class) .withoutAnnotation(Path.class) .hasNumParams(1) .hasReturnType(void.class) .nameStartsWith("set")) { Parameter p = Parameter.create( handlerClass, method.getMethod().getDeclaringClass(), encodedFlag || method.isAnnotationPresent(Encoded.class), method.getParameterTypes()[0], method.getGenericParameterTypes()[0], method.getAnnotations()); if (null != p) { ResourceMethodValidator.validateParameter(p, method.getMethod(), method.getMethod().toGenericString(), "1", InvocableValidator.isSingleton(handlerClass)); // we do not inject entity parameters into class instance fields and properties. if (p.getSource() != Parameter.Source.ENTITY) { injectableParameters.add(p); } } } }