Class TokenWriterArg
java.lang.Object
org.apache.juneau.rest.server.arg.SimpleRestOperationArg
org.apache.juneau.rest.server.arg.TokenWriterArg
- All Implemented Interfaces:
RestOpArg
Resolves method parameters of type
TokenWriter (or any subtype) on
RestOp-annotated Java methods.
Implements two-layer resolution: static parameter type filters eligible serializers; response
Accept negotiates among them. The cursor is opened on a request-configured
SerializerSession so it honors the
same locale / timezone / schema / charset as a normal serialized response.
Declaring this parameter flips the response into "user owns the body" mode.
Rejection paths (all surfaced as HTTP 415 / 406):
- No serializer matched the
Accept— resolution returnsnulland the framework rejects the request (415/406 via the empty match). - Matched serializer does not implement
TokenWritable— throwsUnsupportedMediaType(415). - Matched serializer produces a cursor not assignable to the declared parameter type
— throws
UnsupportedMediaType(415).
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TokenWriterArgcreate(ParameterInfo paramInfo) Static creator.Class<?>Returns the declared parameter type.Methods inherited from class org.apache.juneau.rest.server.arg.SimpleRestOperationArg
resolve
-
Constructor Details
-
TokenWriterArg
Constructor.
-
-
Method Details
-
create
Static creator.- Parameters:
paramInfo- The Java method parameter being resolved. Must not benull .- Returns:
- A new
TokenWriterArg, ornull if the parameter type is notTokenWriteror a subtype.
-
getDeclaredType
Returns the declared parameter type.
-