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 returns null and the framework rejects the request (415/406 via the empty match).
  • Matched serializer does not implement TokenWritable — throws UnsupportedMediaType (415).
  • Matched serializer produces a cursor not assignable to the declared parameter type — throws UnsupportedMediaType (415).
See Also: