This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new 2113414 Context API refactoring.
2113414 is described below
commit 2113414845856a33db431cb806c674f93df75178
Author: JamesBognar <[email protected]>
AuthorDate: Sun Sep 12 11:27:13 2021 -0400
Context API refactoring.
---
.../java/org/apache/juneau/ContextBeanCreator.java | 14 +--
.../org/apache/juneau/httppart/HttpPartParser.java | 8 +-
.../apache/juneau/httppart/HttpPartSerializer.java | 8 +-
.../juneau/httppart/bean/ResponseBeanMeta.java | 4 +-
.../java/org/apache/juneau/rest/RestContext.java | 57 +---------
.../org/apache/juneau/rest/RestContextBuilder.java | 117 +++++++++++++++------
.../java/org/apache/juneau/rest/RestOpContext.java | 4 +-
.../apache/juneau/rest/RestOpContextBuilder.java | 4 +-
.../juneau/rest/annotation/RestAnnotation.java | 4 +-
.../org/apache/juneau/rest/args/FormDataArg.java | 2 +-
.../org/apache/juneau/rest/args/HeaderArg.java | 2 +-
.../java/org/apache/juneau/rest/args/PathArg.java | 2 +-
.../java/org/apache/juneau/rest/args/QueryArg.java | 2 +-
.../apache/juneau/rest/args/ResponseHeaderArg.java | 2 +-
14 files changed, 116 insertions(+), 114 deletions(-)
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ContextBeanCreator.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ContextBeanCreator.java
index 4dd4aae..5befdc5 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ContextBeanCreator.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ContextBeanCreator.java
@@ -39,7 +39,7 @@ public class ContextBeanCreator<T> {
}
private Class<T> type;
- private T value;
+ private T impl;
private ContextBuilder builder;
/**
@@ -58,7 +58,7 @@ public class ContextBeanCreator<T> {
*/
protected ContextBeanCreator(ContextBeanCreator<T> copyFrom) {
this.type = copyFrom.type;
- this.value = copyFrom.value;
+ this.impl = copyFrom.impl;
this.builder = copyFrom.builder == null ? null :
copyFrom.builder.copy();
}
@@ -68,8 +68,8 @@ public class ContextBeanCreator<T> {
* @param value The bean to set.
* @return This object.
*/
- public ContextBeanCreator<T> set(T value) {
- this.value = value;
+ public ContextBeanCreator<T> impl(T value) {
+ this.impl = value;
return this;
}
@@ -83,7 +83,7 @@ public class ContextBeanCreator<T> {
* @return This object.
*/
@SuppressWarnings("unchecked")
- public ContextBeanCreator<T> set(Class<? extends T> value) {
+ public ContextBeanCreator<T> type(Class<? extends T> value) {
builder = Context.createBuilder((Class<? extends Context>)
value);
if (builder == null)
throw runtimeException("Creator for class {0} not
found." + value.getName());
@@ -141,8 +141,8 @@ public class ContextBeanCreator<T> {
*/
@SuppressWarnings("unchecked")
public T create() {
- if (value != null)
- return value;
+ if (impl != null)
+ return impl;
if (builder != null)
return (T)builder.build();
return null;
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartParser.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartParser.java
index 66dfac5..30b1893 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartParser.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartParser.java
@@ -63,14 +63,14 @@ public interface HttpPartParser {
}
@Override
- public Creator set(HttpPartParser value) {
- super.set(value);
+ public Creator impl(HttpPartParser value) {
+ super.impl(value);
return this;
}
@Override
- public Creator set(Class<? extends HttpPartParser> value) {
- super.set(value);
+ public Creator type(Class<? extends HttpPartParser> value) {
+ super.type(value);
return this;
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSerializer.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSerializer.java
index f9c6298..a910f47 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSerializer.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSerializer.java
@@ -76,14 +76,14 @@ public interface HttpPartSerializer {
}
@Override
- public Creator set(HttpPartSerializer value) {
- super.set(value);
+ public Creator impl(HttpPartSerializer value) {
+ super.impl(value);
return this;
}
@Override
- public Creator set(Class<? extends HttpPartSerializer> value) {
- super.set(value);
+ public Creator type(Class<? extends HttpPartSerializer> value) {
+ super.type(value);
return this;
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/bean/ResponseBeanMeta.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/bean/ResponseBeanMeta.java
index b78407b..930aa8e 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/bean/ResponseBeanMeta.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/bean/ResponseBeanMeta.java
@@ -105,8 +105,8 @@ public class ResponseBeanMeta {
ResponseBeanMeta(Builder b) {
this.cm = b.cm;
this.code = b.code;
- this.partSerializer = ofNullable(b.partSerializer).map(x ->
HttpPartSerializer.creator().set(x).apply(b.annotations).create());
- this.partParser = ofNullable(b.partParser).map(x ->
HttpPartParser.creator().set(x).apply(b.annotations).create());
+ this.partSerializer = ofNullable(b.partSerializer).map(x ->
HttpPartSerializer.creator().type(x).apply(b.annotations).create());
+ this.partParser = ofNullable(b.partParser).map(x ->
HttpPartParser.creator().type(x).apply(b.annotations).create());
this.schema = b.schema.build();
Map<String,ResponseBeanPropertyMeta> properties = new
LinkedHashMap<>();
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
index 7fdf04f..a4cea95 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
@@ -262,12 +262,10 @@ public class RestContext extends Context {
responseProcessors = bs.add(ResponseProcessor[].class,
builder.responseProcessors().build().toArray());
debugDefault = builder.debugDefault;
callLogger = bs.add(RestLogger.class,
builder.callLogger().beanStore(beanStore).loggerOnce(logger).thrownStoreOnce(thrownStore).build());
+ partSerializer = bs.add(HttpPartSerializer.class,
builder.partSerializer().create());
Object r = resource.get();
- partSerializer = createPartSerializer(r, builder, bs);
- bs.addBean(HttpPartSerializer.class, partSerializer);
-
partParser = createPartParser(r, builder, bs);
bs.addBean(HttpPartParser.class, partParser);
@@ -621,57 +619,6 @@ public class RestContext extends Context {
}
/**
- * Instantiates the HTTP part serializer for this REST resource.
- *
- * <p>
- * Instantiates based on the following logic:
- * <ul>
- * <li>Returns the resource class itself is an instance of {@link
HttpPartSerializer}.
- * <li>Looks for part serializer set via any of the following:
- * <ul>
- * <li>{@link
RestContextBuilder#getPartSerializer()}
- * <li>{@link Rest#partSerializer()}.
- * </ul>
- * <li>Looks for a static or non-static
<c>createPartSerializer()</> method that returns <c>{@link
HttpPartSerializer}</c> on the
- * resource class with any of the following arguments:
- * <ul>
- * <li>{@link RestContext}
- * <li>{@link BeanStore}
- * <li>Any {@doc RestInjection injected beans}.
- * </ul>
- * <li>Resolves it via the bean store registered in this context.
- * <li>Instantiates an {@link OpenApiSerializer}.
- * </ul>
- *
- * @param resource
- * The REST servlet or bean that this context defines.
- * @param builder
- * The builder for this object.
- * @param beanStore
- * The factory used for creating beans and retrieving injected
beans.
- * <br>Created by {@link RestContextBuilder#beanStore()}.
- * @return The HTTP part serializer for this REST resource.
- * @throws Exception If serializer could not be instantiated.
- */
- protected HttpPartSerializer createPartSerializer(Object resource,
RestContextBuilder builder, BeanStore beanStore) throws Exception {
-
- HttpPartSerializer.Creator x = builder.partSerializer;
-
- if (beanStore.hasBean(HttpPartSerializer.class))
-
x.set(beanStore.getBean(HttpPartSerializer.class).orElse(null));
-
- x = BeanStore
- .of(beanStore, resource)
- .addBean(HttpPartSerializer.Creator.class, x)
-
.beanCreateMethodFinder(HttpPartSerializer.Creator.class, resource)
- .find("createPartSerializer")
- .withDefault(x)
- .run();
-
- return x.create();
- }
-
- /**
* Instantiates the HTTP part parser for this REST resource.
*
* <p>
@@ -709,7 +656,7 @@ public class RestContext extends Context {
HttpPartParser.Creator x = builder.partParser;
if (beanStore.hasBean(HttpPartParser.class))
-
x.set(beanStore.getBean(HttpPartParser.class).orElse(null));
+
x.impl(beanStore.getBean(HttpPartParser.class).orElse(null));
x = BeanStore
.of(beanStore, resource)
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
index 0b56553..820c8fb 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
@@ -59,7 +59,6 @@ import org.apache.juneau.rest.vars.*;
import org.apache.juneau.serializer.*;
import org.apache.juneau.svl.*;
import org.apache.juneau.svl.vars.*;
-import org.apache.juneau.uon.*;
import org.apache.juneau.utils.*;
/**
@@ -132,6 +131,7 @@ public class RestContextBuilder extends ContextBuilder
implements ServletConfig
private Messages.Builder messages;
private ResponseProcessorList.Builder responseProcessors;
private RestLogger.Builder callLogger;
+ private HttpPartSerializer.Creator partSerializer;
String
allowedHeaderParams = env("RestContext.allowedHeaderParams",
"Accept,Content-Type"),
@@ -166,8 +166,7 @@ public class RestContextBuilder extends ContextBuilder
implements ServletConfig
EncoderGroup.Builder encoders =
EncoderGroup.create().add(IdentityEncoder.INSTANCE);
SerializerGroup.Builder serializers = SerializerGroup.create();
ParserGroup.Builder parsers = ParserGroup.create();
- HttpPartSerializer.Creator partSerializer =
HttpPartSerializer.creator().set(OpenApiSerializer.class);
- HttpPartParser.Creator partParser =
HttpPartParser.creator().set(OpenApiParser.class);
+ HttpPartParser.Creator partParser =
HttpPartParser.creator().type(OpenApiParser.class);
Enablement debugDefault, debug;
@@ -1396,6 +1395,90 @@ public class RestContextBuilder extends ContextBuilder
implements ServletConfig
return v.get();
}
+ /**
+ * Returns the part serializer builder for this context.
+ *
+ * @return The part serializer builder for this context.
+ */
+ public final HttpPartSerializer.Creator partSerializer() {
+ if (partSerializer == null)
+ partSerializer = createPartSerializer(beanStore(),
resource());
+ return partSerializer;
+ }
+
+ /**
+ * Instantiates the HTTP part serializer for this REST resource.
+ *
+ * <p>
+ * Instantiates based on the following logic:
+ * <ul>
+ * <li>Returns the resource class itself is an instance of {@link
HttpPartSerializer}.
+ * <li>Looks for part serializer set via any of the following:
+ * <ul>
+ * <li>{@link RestContextBuilder#partSerializer()}
+ * <li>{@link Rest#partSerializer()}.
+ * </ul>
+ * <li>Looks for a static or non-static
<c>createPartSerializer()</> method that returns <c>{@link
HttpPartSerializer}</c> on the
+ * resource class with any of the following arguments:
+ * <ul>
+ * <li>{@link RestContext}
+ * <li>{@link BeanStore}
+ * <li>Any {@doc RestInjection injected beans}.
+ * </ul>
+ * <li>Resolves it via the bean store registered in this context.
+ * <li>Instantiates an {@link OpenApiSerializer}.
+ * </ul>
+ *
+ * @param beanStore
+ * The factory used for creating beans and retrieving injected
beans.
+ * @param resource
+ * The REST servlet or bean that this context defines.
+ * @return The HTTP part serializer for this REST resource.
+ */
+ protected HttpPartSerializer.Creator createPartSerializer(BeanStore
beanStore, Supplier<?> resource) {
+
+ Value<HttpPartSerializer.Creator> v = Value.empty();
+ Object r = resource.get();
+
+ // Get builder from bean store.
+ beanStore.getBean(HttpPartSerializer.Creator.class).map(x ->
x.copy()).ifPresent(x -> v.set(x));
+
+ // Create default.
+ if (v.isEmpty()) {
+ v.set(
+ HttpPartSerializer
+ .creator()
+ .type(OpenApiSerializer.class)
+ );
+ }
+
+ // Set implementation if in bean store.
+ beanStore.getBean(HttpPartSerializer.class).ifPresent(x ->
v.get().impl(x));
+
+ // Set default type.
+ defaultClasses.get(HttpPartSerializer.class).ifPresent(x ->
v.get().type(x));
+
+ // Call: public [static] HttpPartSerializer.Creator
createPartSerializer(<anything-in-bean-store>)
+ BeanStore
+ .of(beanStore, r)
+ .addBean(HttpPartSerializer.Creator.class, v.get())
+
.beanCreateMethodFinder(HttpPartSerializer.Creator.class, resource)
+ .find("createPartSerializer")
+ .execute()
+ .ifPresent(x -> v.set(x));
+
+ // Call: public [static] HttpPartSerializer
createPartSerializer(<anything-in-bean-store>)
+ BeanStore
+ .of(beanStore, r)
+ .addBean(HttpPartSerializer.Creator.class, v.get())
+ .beanCreateMethodFinder(HttpPartSerializer.class,
resource)
+ .find("createPartSerializer")
+ .execute()
+ .ifPresent(x -> v.get().impl(x));
+
+ return v.get();
+ }
+
//----------------------------------------------------------------------------------------------------
// Methods that give access to the config file, var resolver, and
properties.
//----------------------------------------------------------------------------------------------------
@@ -1471,30 +1554,6 @@ public class RestContextBuilder extends ContextBuilder
implements ServletConfig
}
/**
- * Returns the HTTP part serializer creator containing the part
serializer for serializing POJOs to HTTP parts.
- *
- * <p>
- * The default value is {@link OpenApiSerializer} which serializes
based on OpenAPI rules, but defaults to UON notation for beans and maps, and
- * plain text for everything else.
- *
- * <p>
- * <br>Other options include:
- * <ul>
- * <li class='jc'>{@link SimplePartSerializer} - Always serializes
to plain text.
- * <li class='jc'>{@link UonSerializer} - Always serializers to
UON.
- * </ul>
- *
- * <p>
- * When specified as a class, annotations on this class are applied to
the serializer.
- * Otherwise when specified as an already-instantiated {@link
HttpPartSerializer}, annotations will not be applied.
- *
- * @return The HTTP part serializer creator.
- */
- public HttpPartSerializer.Creator getPartSerializer() {
- return partSerializer;
- }
-
- /**
* Returns the encoder group builder containing the encoders for
compressing/decompressing input and output streams.
*
* <p>
@@ -3470,10 +3529,6 @@ public class RestContextBuilder extends ContextBuilder
implements ServletConfig
@Override /* GENERATED - ContextBuilder */
public RestContextBuilder apply(AnnotationWorkList work) {
super.apply(work);
- serializers.apply(work);
- parsers.apply(work);
- partSerializer.apply(work);
- partParser.apply(work);
return this;
}
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOpContext.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOpContext.java
index 74c55e4..f2609c9 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOpContext.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOpContext.java
@@ -525,7 +525,7 @@ public class RestOpContext extends BeanContext implements
Comparable<RestOpConte
* <li>Returns the resource class itself is an instance of {@link
HttpPartSerializer}.
* <li>Looks for part serializer set via any of the following:
* <ul>
- * <li>{@link
RestContextBuilder#getPartSerializer()}
+ * <li>{@link RestContextBuilder#partSerializer()}
* <li>{@link Rest#partSerializer()}.
* </ul>
* <li>Looks for a static or non-static
<c>createPartSerializer()</> method that returns <c>{@link
HttpPartSerializer}</c> on the
@@ -555,7 +555,7 @@ public class RestOpContext extends BeanContext implements
Comparable<RestOpConte
HttpPartSerializer.Creator x = builder.partSerializer;
if (x == null)
- x = builder.restContext.builder.partSerializer;
+ x = builder.restContext.builder.partSerializer();
x = BeanStore
.of(beanStore, resource)
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOpContextBuilder.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOpContextBuilder.java
index e6142ce..0523915 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOpContextBuilder.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOpContextBuilder.java
@@ -122,7 +122,7 @@ public class RestOpContextBuilder extends
BeanContextBuilder {
getSerializers().apply(al);
if (context.builder.parsers.canApply(al))
getParsers().apply(al);
- if (context.builder.partSerializer.canApply(al))
+ if (context.builder.partSerializer().canApply(al))
getPartSerializer().apply(al);
if (context.builder.partParser.canApply(al))
getPartParser().apply(al);
@@ -235,7 +235,7 @@ public class RestOpContextBuilder extends
BeanContextBuilder {
*/
public HttpPartSerializer.Creator getPartSerializer() {
if (partSerializer == null)
- partSerializer =
restContext.builder.partSerializer.copy();
+ partSerializer =
restContext.builder.partSerializer().copy();
return partSerializer;
}
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestAnnotation.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestAnnotation.java
index 2219373..e17ffd2 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestAnnotation.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestAnnotation.java
@@ -1049,8 +1049,8 @@ public class RestAnnotation {
classes(a.serializers()).ifPresent(x ->
b.getSerializers().add(x));
classes(a.parsers()).ifPresent(x ->
b.getParsers().add(x));
- type(a.partSerializer()).ifPresent(x ->
b.getPartSerializer().set(x));
- type(a.partParser()).ifPresent(x ->
b.getPartParser().set(x));
+ type(a.partSerializer()).ifPresent(x ->
b.partSerializer().type(x));
+ type(a.partParser()).ifPresent(x ->
b.getPartParser().type(x));
strings(a.produces()).map(MediaType::of).forEach(x ->
b.produces(x));
strings(a.consumes()).map(MediaType::of).forEach(x ->
b.consumes(x));
strings(a.defaultRequestAttributes()).map(x ->
BasicNamedAttribute.ofPair(x)).forEach(x -> b.defaultRequestAttributes(x));
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/FormDataArg.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/FormDataArg.java
index e00ba9b..c1eb01e 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/FormDataArg.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/FormDataArg.java
@@ -63,7 +63,7 @@ public class FormDataArg implements RestOpArg {
this.name = getName(paramInfo);
this.type = paramInfo.getParameterType();
this.schema = HttpPartSchema.create(FormData.class, paramInfo);
- this.partParser = ofNullable(schema.getParser()).map(x ->
HttpPartParser.creator().set(x).apply(annotations).create()).orElse(null);
+ this.partParser = ofNullable(schema.getParser()).map(x ->
HttpPartParser.creator().type(x).apply(annotations).create()).orElse(null);
this.multi = getMulti(paramInfo) ||
schema.getCollectionFormat() == HttpPartCollectionFormat.MULTI;
if (multi && ! type.isCollectionOrArray())
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/HeaderArg.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/HeaderArg.java
index 573670f..a784c69 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/HeaderArg.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/HeaderArg.java
@@ -66,7 +66,7 @@ public class HeaderArg implements RestOpArg {
this.name = getName(paramInfo);
this.type = paramInfo.getParameterType();
this.schema = HttpPartSchema.create(Header.class, paramInfo);
- this.partParser = ofNullable(schema.getParser()).map(x ->
HttpPartParser.creator().set(x).apply(annotations).create()).orElse(null);
+ this.partParser = ofNullable(schema.getParser()).map(x ->
HttpPartParser.creator().type(x).apply(annotations).create()).orElse(null);
this.multi = getMulti(paramInfo);
if (multi && ! type.isCollectionOrArray())
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/PathArg.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/PathArg.java
index b777b49..7c1ae36 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/PathArg.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/PathArg.java
@@ -61,7 +61,7 @@ public class PathArg implements RestOpArg {
this.name = getName(paramInfo, pathMatcher);
this.type = paramInfo.getParameterType().innerType();
this.schema = HttpPartSchema.create(Path.class, paramInfo);
- this.partParser = ofNullable(schema.getParser()).map(x ->
HttpPartParser.creator().set(x).apply(annotations).create()).orElse(null);
+ this.partParser = ofNullable(schema.getParser()).map(x ->
HttpPartParser.creator().type(x).apply(annotations).create()).orElse(null);
}
private String getName(ParamInfo paramInfo, UrlPathMatcher pathMatcher)
{
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/QueryArg.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/QueryArg.java
index 2fe190e..29b4f9f 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/QueryArg.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/QueryArg.java
@@ -63,7 +63,7 @@ public class QueryArg implements RestOpArg {
this.name = getName(paramInfo);
this.type = paramInfo.getParameterType();
this.schema = HttpPartSchema.create(Query.class, paramInfo);
- this.partParser = ofNullable(schema.getParser()).map(x ->
HttpPartParser.creator().set(x).apply(annotations).create()).orElse(null);
+ this.partParser = ofNullable(schema.getParser()).map(x ->
HttpPartParser.creator().type(x).apply(annotations).create()).orElse(null);
this.multi = getMulti(paramInfo) ||
schema.getCollectionFormat() == HttpPartCollectionFormat.MULTI;
if (multi && ! type.isCollectionOrArray())
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/ResponseHeaderArg.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/ResponseHeaderArg.java
index 7fa23c0..51a2eb6 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/ResponseHeaderArg.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/ResponseHeaderArg.java
@@ -61,7 +61,7 @@ public class ResponseHeaderArg implements RestOpArg {
this.name = getName(paramInfo);
this.type = paramInfo.getParameterType().innerType();
HttpPartSchema schema =
HttpPartSchema.create(ResponseHeader.class, paramInfo);
- this.meta = new ResponsePartMeta(HttpPartType.HEADER, schema,
ofNullable(schema.getSerializer()).map(x ->
HttpPartSerializer.creator().set(x).apply(annotations).create()).orElse(null));
+ this.meta = new ResponsePartMeta(HttpPartType.HEADER, schema,
ofNullable(schema.getSerializer()).map(x ->
HttpPartSerializer.creator().type(x).apply(annotations).create()).orElse(null));
Class<?> c = type instanceof Class ? (Class<?>)type : type
instanceof ParameterizedType ? (Class<?>)((ParameterizedType)type).getRawType()
: null;
if (c != Value.class)