Class RecordReaderArg
java.lang.Object
org.apache.juneau.rest.server.arg.SimpleRestOperationArg
org.apache.juneau.rest.server.arg.RecordReaderArg
- All Implemented Interfaces:
RestOpArg
Resolves method parameters of type
RecordReader (or any subtype) on
RestOp-annotated Java methods.
The parameter value is resolved by:
- Negotiating the request's
Content-Typeto a matchedParser. - Building a request-configured
ParserSessionand callingreadRecords(input)on it whereinputis the request reader (text formats) or input stream (binary formats). - Verifying the returned cursor's runtime type is assignable to the declared parameter
type — this enforces the two-layer resolution for concrete cursor subtypes
(e.g.
JsonTokenReader).
Rejection paths (all surfaced as HTTP 415 / 406):
- No parser matched the
Content-Type— resolution returnsnulland the framework rejects the request (415/406 via the empty match). - Matched parser does not implement
RecordReadable— throwsUnsupportedMediaType(415). - Matched parser produces a cursor not assignable to the declared parameter type
— throws
UnsupportedMediaType(415).
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RecordReaderArgcreate(ParameterInfo paramInfo) Static creator.Class<?>Returns the declared parameter type for diagnostic / introspection use.Methods inherited from class org.apache.juneau.rest.server.arg.SimpleRestOperationArg
resolve
-
Constructor Details
-
RecordReaderArg
Constructor.- Parameters:
declaredType- The declared parameter type (used to verify the matched parser's cursor type is assignable to the parameter).
-
-
Method Details
-
create
Static creator.- Parameters:
paramInfo- The Java method parameter being resolved. Must not benull .- Returns:
- A new
RecordReaderArg, ornull if the parameter type is notRecordReaderor a subtype (other thanTokenReader— that case is handled byTokenReaderArg).
-
getDeclaredType
Returns the declared parameter type for diagnostic / introspection use.
-