/** * Adds name bindings. The passed annotations not annotated with {@link javax.ws.rs.NameBinding} * meta-annotation will be ignored. * * @param nameBindings name binding annotations. * @return updated builder object. */ public Builder nameBindings(final Annotation... nameBindings) { return nameBindings( Arrays.stream(nameBindings) .map((Function<Annotation, Class<? extends Annotation>>) Annotation::annotationType) .collect(Collectors.toList()) ); }
/** * Adds name bindings. The passed annotations not annotated with {@link javax.ws.rs.NameBinding} * meta-annotation will be ignored. * * @param nameBindings name binding annotations. * @return updated builder object. */ public Builder nameBindings(final Annotation... nameBindings) { return nameBindings( Arrays.stream(nameBindings) .map((Function<Annotation, Class<? extends Annotation>>) Annotation::annotationType) .collect(Collectors.toList()) ); }
/** * Adds name bindings. The passed annotation types not annotated with {@link javax.ws.rs.NameBinding} * meta-annotation will be ignored. * * @param nameBindings name binding annotation types. * @return updated builder object. */ @SafeVarargs public final Builder nameBindings(final Class<? extends Annotation>... nameBindings) { return nameBindings(Arrays.asList(nameBindings)); }
/** * Adds name bindings. The passed annotations not annotated with {@link javax.ws.rs.NameBinding} * meta-annotation will be ignored. * * @param nameBindings name binding annotations. * @return updated builder object. */ public Builder nameBindings(final Annotation... nameBindings) { return nameBindings(Collections2.transform(Arrays.asList(nameBindings), new Function<Annotation, Class<? extends Annotation>>() { @Override public Class<? extends Annotation> apply(Annotation input) { return input.annotationType(); } }) ); }
/** * Adds name bindings. The passed annotations not annotated with {@link javax.ws.rs.NameBinding} * meta-annotation will be ignored. * * @param nameBindings name binding annotations. * @return updated builder object. */ public Builder nameBindings(final Annotation... nameBindings) { return nameBindings(Collections2.transform(Arrays.asList(nameBindings), new Function<Annotation, Class<? extends Annotation>>() { @Override public Class<? extends Annotation> apply(Annotation input) { return input.annotationType(); } }) ); }
/** * Adds name bindings. The passed annotations not annotated with {@link javax.ws.rs.NameBinding} * meta-annotation will be ignored. * * @param nameBindings name binding annotations. * @return updated builder object. */ public Builder nameBindings(final Annotation... nameBindings) { return nameBindings(Collections2.transform(Arrays.asList(nameBindings), new Function<Annotation, Class<? extends Annotation>>() { @Override public Class<? extends Annotation> apply(Annotation input) { return input.annotationType(); } }) ); }
/** * Adds name bindings. The passed annotations not annotated with {@link javax.ws.rs.NameBinding} * meta-annotation will be ignored. * * @param nameBindings name binding annotations. * @return updated builder object. */ public Builder nameBindings(final Annotation... nameBindings) { return nameBindings( Arrays.stream(nameBindings) .map((Function<Annotation, Class<? extends Annotation>>) Annotation::annotationType) .collect(Collectors.toList()) ); }
/** * Adds name bindings. The passed annotation types not annotated with {@link javax.ws.rs.NameBinding} * meta-annotation will be ignored. * * @param nameBindings name binding annotation types. * @return updated builder object. */ @SafeVarargs public final Builder nameBindings(final Class<? extends Annotation>... nameBindings) { return nameBindings(Arrays.asList(nameBindings)); }
/** * Adds name bindings. The passed annotation types not annotated with {@link javax.ws.rs.NameBinding} * meta-annotation will be ignored. * * @param nameBindings name binding annotation types. * @return updated builder object. */ @SafeVarargs public final Builder nameBindings(final Class<? extends Annotation>... nameBindings) { return nameBindings(Arrays.asList(nameBindings)); }
/** * Adds name bindings. The passed annotation types not annotated with {@link javax.ws.rs.NameBinding} * meta-annotation will be ignored. * * @param nameBindings name binding annotation types. * @return updated builder object. */ @SafeVarargs public final Builder nameBindings(final Class<? extends Annotation>... nameBindings) { return nameBindings(Arrays.asList(nameBindings)); }
/** * Adds name bindings. The passed annotation types not annotated with {@link javax.ws.rs.NameBinding} * meta-annotation will be ignored. * * @param nameBindings name binding annotation types. * @return updated builder object. */ @SafeVarargs public final Builder nameBindings(final Class<? extends Annotation>... nameBindings) { return nameBindings(Arrays.asList(nameBindings)); }
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 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); } }
/** * Adds name bindings. The passed annotations not annotated with {@link javax.ws.rs.NameBinding} * meta-annotation will be ignored. * * @param nameBindings name binding annotations. * @return updated builder object. */ public Builder nameBindings(final Annotation... nameBindings) { return nameBindings( Arrays.stream(nameBindings) .map((Function<Annotation, Class<? extends Annotation>>) Annotation::annotationType) .collect(Collectors.toList()) ); }
/** * Adds name bindings. The passed annotation types not annotated with {@link javax.ws.rs.NameBinding} * meta-annotation will be ignored. * * @param nameBindings name binding annotation types. * @return updated builder object. */ @SafeVarargs public final Builder nameBindings(final Class<? extends Annotation>... nameBindings) { return nameBindings(Arrays.asList(nameBindings)); }
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); } }
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); } }
/** * Adds name bindings. The passed annotation types not annotated with {@link javax.ws.rs.NameBinding} * meta-annotation will be ignored. * * @param nameBindings name binding annotation types. * @return updated builder object. */ @SafeVarargs public final Builder nameBindings(final Class<? extends Annotation>... nameBindings) { return nameBindings(Arrays.asList(nameBindings)); }