Class QueryArg

java.lang.Object
org.apache.juneau.rest.arg.QueryArg
All Implemented Interfaces:
RestOpArg

public class QueryArg extends Object implements RestOpArg
Resolves method parameters and parameter types annotated with Query on RestOp-annotated Java methods.

The parameter value is resolved using:

opSession .getRequest() .getQueryParams() .get(name) .as(type);

schema is derived from the Query annotation.

If the Schema.collectionFormat() value is HttpPartCollectionFormat.MULTI, then the data type can be a Collection or array.

See Also:
  • Constructor Details

    • QueryArg

      protected QueryArg(ParamInfo pi, AnnotationWorkList annotations)
      Constructor.
      Parameters:
      pi - The Java method parameter being resolved.
      annotations - The annotations to apply to any new part parsers.
  • Method Details

    • create

      public static QueryArg create(ParamInfo paramInfo, AnnotationWorkList annotations)
      Static creator.
      Parameters:
      paramInfo - The Java method parameter being resolved.
      annotations - The annotations to apply to any new part parsers.
      Returns:
      A new QueryArg, or null if the parameter is not annotated with Query.
    • resolve

      public Object resolve(RestOpSession opSession) throws Exception
      Description copied from interface: RestOpArg
      Resolves the parameter object.
      Specified by:
      resolve in interface RestOpArg
      Parameters:
      opSession - The rest call.
      Returns:
      The resolved object.
      Throws:
      Exception - Generic error occurred.