Class PathArg

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

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

The parameter value is resolved using:

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

schema is derived from the Path annotation.

See Also:
  • Constructor Details

    • PathArg

      protected PathArg(ParamInfo paramInfo, AnnotationWorkList annotations, UrlPathMatcher pathMatcher)
      Constructor.
      Parameters:
      paramInfo - The Java method parameter being resolved.
      annotations - The annotations to apply to any new part parsers.
      pathMatcher - Path matcher for the specified method.
  • Method Details

    • create

      public static PathArg create(ParamInfo paramInfo, AnnotationWorkList annotations, UrlPathMatcher pathMatcher)
      Static creator.
      Parameters:
      paramInfo - The Java method parameter being resolved.
      annotations - The annotations to apply to any new part parsers.
      pathMatcher - Path matcher for the specified method.
      Returns:
      A new PathArg, or null if the parameter is not annotated with Path.
    • 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.