@Override public Annotation[] getDeclaredAnnotations() { return getAnnotations(); }
@Override public Annotation[] getDeclaredAnnotations() { return getAnnotations(); }
@Override public boolean keep(AnnotatedMethod m) { for (Annotation a : m.getAnnotations()) { if (a.annotationType().getAnnotation(annotation) != null) { return false; } } return true; } });
@Override public boolean keep(AnnotatedMethod m) { for (Annotation a : m.getAnnotations()) { if (a.annotationType().getAnnotation(annotation) != null) { return false; } } return true; } });
@Override public boolean keep(AnnotatedMethod m) { for (Annotation a : m.getAnnotations()) { if (a.annotationType().getAnnotation(annotation) != null) { return true; } } return false; } });
@Override public boolean keep(AnnotatedMethod m) { for (Annotation a : m.getAnnotations()) { if (a.annotationType().getAnnotation(annotation) != null) { return true; } } return false; } });
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); } } } }
@Override public Annotation[] getDeclaredAnnotations() { return getAnnotations(); }
private void addSubResourceMethods( final Resource.Builder resourceBuilder, final MethodList methodList, final List<Parameter> resourceClassParameters, // parameters derived from fields and setters on the resource class final boolean encodedParameters, final List<MediaType> defaultConsumedTypes, final List<MediaType> defaultProducedTypes, final Collection<Class<? extends Annotation>> defaultNameBindings, final boolean extended ) { for (AnnotatedMethod am : methodList.withMetaAnnotation(HttpMethod.class).withAnnotation(Path.class)) { Resource.Builder childResourceBuilder = resourceBuilder.addChildResource(am.getAnnotation(Path.class).value()); ResourceMethod.Builder methodBuilder = childResourceBuilder.addMethod(am.getMetaMethodAnnotations(HttpMethod.class).get(0).value()) .consumes(resolveConsumedTypes(am, defaultConsumedTypes)) .produces(resolveProducedTypes(am, defaultProducedTypes)) .encodedParameters(encodedParameters || am.isAnnotationPresent(Encoded.class)) .nameBindings(defaultNameBindings) .nameBindings(am.getAnnotations()) .handledBy(handlerClass, am.getMethod()) .handlingMethod(am.getDeclaredMethod()) .handlerParameters(resourceClassParameters) .extended(extended || am.isAnnotationPresent(ExtendedResource.class)); introspectAsyncFeatures(am, methodBuilder); } }
private void addSubResourceMethods( final Resource.Builder resourceBuilder, final MethodList methodList, final List<Parameter> resourceClassParameters, // parameters derived from fields and setters on the resource class final boolean encodedParameters, final List<MediaType> defaultConsumedTypes, final List<MediaType> defaultProducedTypes, final Collection<Class<? extends Annotation>> defaultNameBindings, final boolean extended ) { for (AnnotatedMethod am : methodList.withMetaAnnotation(HttpMethod.class).withAnnotation(Path.class)) { Resource.Builder childResourceBuilder = resourceBuilder.addChildResource(am.getAnnotation(Path.class).value()); ResourceMethod.Builder methodBuilder = childResourceBuilder.addMethod(am.getMetaMethodAnnotations(HttpMethod.class).get(0).value()) .consumes(resolveConsumedTypes(am, defaultConsumedTypes)) .produces(resolveProducedTypes(am, defaultProducedTypes)) .encodedParameters(encodedParameters || am.isAnnotationPresent(Encoded.class)) .nameBindings(defaultNameBindings) .nameBindings(am.getAnnotations()) .handledBy(handlerClass, am.getMethod()) .handlingMethod(am.getDeclaredMethod()) .handlerParameters(resourceClassParameters) .extended(extended || am.isAnnotationPresent(ExtendedResource.class)); introspectAsyncFeatures(am, methodBuilder); } }
@Override public boolean keep(AnnotatedMethod m) { for (Annotation a : m.getAnnotations()) { if (a.annotationType().getAnnotation(annotation) != null) { return true; } } return false; } });
@Override public boolean keep(AnnotatedMethod m) { for (Annotation a : m.getAnnotations()) { if (a.annotationType().getAnnotation(annotation) != null) { return false; } } return true; } });
private void addResourceMethods( final Resource.Builder resourceBuilder, final MethodList methodList, final List<Parameter> resourceClassParameters, // parameters derived from fields and setters on the resource class final boolean encodedParameters, final List<MediaType> defaultConsumedTypes, final List<MediaType> defaultProducedTypes, final Collection<Class<? extends Annotation>> defaultNameBindings, final boolean extended ) { for (AnnotatedMethod am : methodList.withMetaAnnotation(HttpMethod.class).withoutAnnotation(Path.class)) { ResourceMethod.Builder methodBuilder = resourceBuilder.addMethod(am.getMetaMethodAnnotations(HttpMethod.class).get(0).value()) .consumes(resolveConsumedTypes(am, defaultConsumedTypes)) .produces(resolveProducedTypes(am, defaultProducedTypes)) .encodedParameters(encodedParameters || am.isAnnotationPresent(Encoded.class)) .nameBindings(defaultNameBindings) .nameBindings(am.getAnnotations()) .handledBy(handlerClass, am.getMethod()) .handlingMethod(am.getDeclaredMethod()) .handlerParameters(resourceClassParameters) .extended(extended || am.isAnnotationPresent(ExtendedResource.class)); introspectAsyncFeatures(am, methodBuilder); } }
private void addResourceMethods( final Resource.Builder resourceBuilder, final MethodList methodList, final List<Parameter> resourceClassParameters, // parameters derived from fields and setters on the resource class final boolean encodedParameters, final List<MediaType> defaultConsumedTypes, final List<MediaType> defaultProducedTypes, final Collection<Class<? extends Annotation>> defaultNameBindings, final boolean extended ) { for (AnnotatedMethod am : methodList.withMetaAnnotation(HttpMethod.class).withoutAnnotation(Path.class)) { ResourceMethod.Builder methodBuilder = resourceBuilder.addMethod(am.getMetaMethodAnnotations(HttpMethod.class).get(0).value()) .consumes(resolveConsumedTypes(am, defaultConsumedTypes)) .produces(resolveProducedTypes(am, defaultProducedTypes)) .encodedParameters(encodedParameters || am.isAnnotationPresent(Encoded.class)) .nameBindings(defaultNameBindings) .nameBindings(am.getAnnotations()) .handledBy(handlerClass, am.getMethod()) .handlingMethod(am.getDeclaredMethod()) .handlerParameters(resourceClassParameters) .extended(extended || am.isAnnotationPresent(ExtendedResource.class)); introspectAsyncFeatures(am, methodBuilder); } }
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); } } } }
@Override public boolean keep(AnnotatedMethod m) { for (Annotation a : m.getAnnotations()) { if (a.annotationType().getAnnotation(annotation) != null) { return true; } } return false; } });
@Override public boolean keep(AnnotatedMethod m) { for (Annotation a : m.getAnnotations()) { if (a.annotationType().getAnnotation(annotation) != null) { return false; } } return true; } });
private void addSubResourceMethods( final Resource.Builder resourceBuilder, final MethodList methodList, final List<Parameter> resourceClassParameters, // parameters derived from fields and setters on the resource class final boolean encodedParameters, final List<MediaType> defaultConsumedTypes, final List<MediaType> defaultProducedTypes, final Collection<Class<? extends Annotation>> defaultNameBindings, final boolean extended ) { for (AnnotatedMethod am : methodList.withMetaAnnotation(HttpMethod.class).withAnnotation(Path.class)) { Resource.Builder childResourceBuilder = resourceBuilder.addChildResource(am.getAnnotation(Path.class).value()); ResourceMethod.Builder methodBuilder = childResourceBuilder.addMethod(am.getMetaMethodAnnotations(HttpMethod.class).get(0).value()) .consumes(resolveConsumedTypes(am, defaultConsumedTypes)) .produces(resolveProducedTypes(am, defaultProducedTypes)) .encodedParameters(encodedParameters || am.isAnnotationPresent(Encoded.class)) .nameBindings(defaultNameBindings) .nameBindings(am.getAnnotations()) .handledBy(handlerClass, am.getMethod()) .handlingMethod(am.getDeclaredMethod()) .handlerParameters(resourceClassParameters) .extended(extended || am.isAnnotationPresent(ExtendedResource.class)); introspectAsyncFeatures(am, methodBuilder); } }
private void addResourceMethods( final Resource.Builder resourceBuilder, final MethodList methodList, final List<Parameter> resourceClassParameters, // parameters derived from fields and setters on the resource class final boolean encodedParameters, final List<MediaType> defaultConsumedTypes, final List<MediaType> defaultProducedTypes, final Collection<Class<? extends Annotation>> defaultNameBindings, final boolean extended ) { for (AnnotatedMethod am : methodList.withMetaAnnotation(HttpMethod.class).withoutAnnotation(Path.class)) { ResourceMethod.Builder methodBuilder = resourceBuilder.addMethod(am.getMetaMethodAnnotations(HttpMethod.class).get(0).value()) .consumes(resolveConsumedTypes(am, defaultConsumedTypes)) .produces(resolveProducedTypes(am, defaultProducedTypes)) .encodedParameters(encodedParameters || am.isAnnotationPresent(Encoded.class)) .nameBindings(defaultNameBindings) .nameBindings(am.getAnnotations()) .handledBy(handlerClass, am.getMethod()) .handlingMethod(am.getDeclaredMethod()) .handlerParameters(resourceClassParameters) .extended(extended || am.isAnnotationPresent(ExtendedResource.class)); introspectAsyncFeatures(am, methodBuilder); } }