Class RecordWriterArg

java.lang.Object
org.apache.juneau.rest.server.arg.SimpleRestOperationArg
org.apache.juneau.rest.server.arg.RecordWriterArg
All Implemented Interfaces:
RestOpArg

Resolves method parameters of type RecordWriter (or any subtype) on RestOp-annotated Java methods.

The parameter value is resolved by:

  1. Negotiating the response's Accept to a matched Serializer.
  2. Building a request-configured SerializerSession and calling writeRecords(output) on it.
  3. Verifying the returned cursor is assignable to the declared parameter type.

Declaring this parameter flips the response into "user owns the body" mode — the framework will not later serialize a POJO return value over the same stream. Same contract as declaring an OutputStream or Writer parameter today.

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 RecordWritable — throws UnsupportedMediaType (415).
  • Matched serializer produces a cursor not assignable to the declared parameter type — throws UnsupportedMediaType (415).
See Also: