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:
- Negotiating the response's
Acceptto a matchedSerializer. - Building a request-configured
SerializerSessionand callingwriteRecords(output)on it. - 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 returnsnulland the framework rejects the request (415/406 via the empty match). - Matched serializer does not implement
RecordWritable— 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 RecordWriterArgcreate(ParameterInfo paramInfo) Static creator.Class<?>Returns the declared parameter type.Methods inherited from class org.apache.juneau.rest.server.arg.SimpleRestOperationArg
resolve
-
Constructor Details
-
RecordWriterArg
Constructor.
-
-
Method Details
-
create
Static creator.- Parameters:
paramInfo- The Java method parameter being resolved. Must not benull .- Returns:
- A new
RecordWriterArg, ornull if the parameter type is notRecordWriteror a subtype (other thanTokenWriter— that case is handled byTokenWriterArg).
-
getDeclaredType
Returns the declared parameter type.
-