{title:'Java Method Parameters', updated:'9.0.0'}

Java methods can contain any of the following parameters in any order:

- Parameters based on class types:
  - Request objects:
    - {@link javax.servlet.AsyncContext}
    - {@link oajr.arg.CookieList}
    - {@link javax.servlet.DispatcherType}
    - {@link oaj.httppart.HttpPartParserSession}
    - {@link oaj.httppart.HttpPartSerializerSession}
    - {@link javax.servlet.HttpServletRequest}
    - {@link java.io.InputStream}
    - {@link oaj.parser.InputStreamParser}
    - {@link java.util.Locale}
    - {@link oaj.cp.Messages}
    - {@link oaj.parser.Parser}
    - {@link java.security.Principal}
    - {@link java.io.Reader}
    - {@link oaj.parser.ReaderParser}
    - {@link oajr.httppart.RequestAttributes}
    - {@link oajr.httppart.RequestContent}
    - {@link oajr.httppart.RequestFormParams}
    - {@link oajr.httppart.RequestHeaders}
    - {@link oajr.httppart.RequestPathParams}
    - {@link oajr.httppart.RequestQueryParams}
    - {@link java.util.ResourceBundle}
    - {@link oajr.RestRequest}
    - {@link javax.servlet.ServletInputStream}
    - {@link oaj.dto.swagger.Swagger}
    - {@link java.util.TimeZone}
    - {@link oaj.UriContext}
    - {@link oaj.UriResolver}
    - {@link oaj.svl.VarResolverSession}
  - Response objects:
    - {@link javax.servlet.HttpServletResponse}
    - {@link java.io.OutputStream}
    - {@link oajr.RestResponse}
    - {@link javax.servlet.ServletOutputStream}
    - {@link java.io.Writer}
  - Session objects:
    - {@link javax.servlet.http.HttpSession}
    - {@link oajr.RestSession}
    - {@link oajr.util.UrlPath}
    - {@link oajr.util.UrlPathMatch}
    - {@link oaj.cp.BeanStore}
    - {@link oajr.RestOpSession}
  - Parsed request header values:
    - {@link oaj.http.header.Accept}
    - {@link oaj.http.header.AcceptCharset}
    - {@link oaj.http.header.AcceptEncoding}
    - {@link oaj.http.header.AcceptLanguage}
    - {@link oaj.http.header.AcceptRanges}
    - {@link oaj.http.header.Authorization}
    - {@link oaj.http.header.CacheControl}
    - {@link oaj.http.header.ClientVersion}
    - {@link oaj.http.header.Connection}
    - {@link oaj.http.header.ContentDisposition}
    - {@link oaj.http.header.ContentEncoding}
    - {@link oaj.http.header.ContentLength}
    - {@link oaj.http.header.ContentType}
    - {@link oaj.http.header.Date}
    - {@link oaj.http.header.Debug}
    - {@link oaj.http.header.Expect}
    - {@link oaj.http.header.Forwarded}
    - {@link oaj.http.header.From}
    - {@link oaj.http.header.Host}
    - {@link oaj.http.header.IfMatch}
    - {@link oaj.http.header.IfModifiedSince}
    - {@link oaj.http.header.IfNoneMatch}
    - {@link oaj.http.header.IfRange}
    - {@link oaj.http.header.IfUnmodifiedSince}
    - {@link oaj.http.header.MaxForwards}
    - {@link oaj.http.header.NoTrace}
    - {@link oaj.http.header.Origin}
    - {@link oaj.http.header.Pragma}
    - {@link oaj.http.header.ProxyAuthorization}
    - {@link oaj.http.header.Range}
    - {@link oaj.http.header.Referer}
    - {@link oaj.http.header.TE}
    - {@link oaj.http.header.Thrown}
    - {@link oaj.http.header.Upgrade}
    - {@link oaj.http.header.UserAgent}
    - {@link oaj.http.header.Warning}
  - Context values:
    - {@link oaj.BeanContext}
    - {@link oaj.config.Config}
    - {@link oajr.debug.DebugEnablement}
    - {@link oaj.encoders.EncoderSet}
    - {@link oaj.cp.FileFinder}
    - {@link oaj.jsonschema.JsonSchemaGenerator}
    - {@link java.util.Logger}
    - {@link oajr.stats.MethodExecStore}
    - {@link oaj.parser.ParserSet}
    - {@link oajr.RestChildren}
    - {@link oajr.RestContext}
    - {@link oajr.stats.RestContextStats}
    - {@link oajr.logging.RestLogger}
    - {@link oajr.RestOpContext}
    - {@link oajr.RestOperations}
    - {@link oaj.serializer.SerializerSet}
    - {@link oajr.staticfile.StaticFiles}
    - {@link oajr.stats.ThrownStore}
- Annotated parameters (either on the parameter or parameter type):
  - {@link oajr.annotation.Attr}
  - {@link oaj.http.annotation.Content}
  - {@link oaj.http.annotation.Path}
  - {@link oaj.http.annotation.FormData}
  - {@link oaj.http.annotation.HasFormData}
  - {@link oaj.http.annotation.Query}
  - {@link oaj.http.annotation.HasQuery}
  - {@link oaj.http.annotation.Header}
  - {@link oaj.http.annotation.StatusCode}
  - {@link oajr.annotation.Method}
  - {@link oaj.http.annotation.Request}
  - {@link oaj.http.annotation.Response}

In Spring Boot environments, any available Spring Beans can also be passed in as parameters.

##### Example:

| @RestGet("/example1/{a1}/{a2}/{a3}/*") | public String doGetExample1( | RestRequest req, | RestResponse res, | @Method String method, | @Path("a1") String a1, | @Path("a2") int a2, | @Path("a3") UUID a3, | @Query("p1") int p1, | @Query("p2") String p2, | @Query("p3") UUID p3, | @HasQuery("p3") boolean hasP3, | @Path("/*") String remainder, | @Header("Accept-Language") String lang, | @Header("Accept") String accept, | @Header("DNT") int doNotTrack, | RequestAttributes attributes, | ResourceBundle nls | ) { | // Do something with all of those | }

Additional parameter types can be defined by overriding {@link oajr.RestContext.Builder#createRestOpArgs(BeanStore,Supplier)} or by adding them to the bean store using {@link oajr.RestContext.Builder#createBeanStore(Class,Supplier)}.