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:

  1. Negotiating the request's Content-Type to a matched Parser.
  2. Building a request-configured ParserSession and calling readRecords(input) on it where input is the request reader (text formats) or input stream (binary formats).
  3. 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 returns null and the framework rejects the request (415/406 via the empty match).
  • Matched parser does not implement RecordReadable — throws UnsupportedMediaType (415).
  • Matched parser produces a cursor not assignable to the declared parameter type — throws UnsupportedMediaType (415).
See Also:
  • Constructor Details

    • RecordReaderArg

      protected RecordReaderArg(Class<?> declaredType)
      Constructor.
      Parameters:
      declaredType - The declared parameter type (used to verify the matched parser's cursor type is assignable to the parameter).
  • Method Details