HttpRequestParametersHashModel (FreeMarker 2.3.35 API)
Description: declaration: package: freemarker.ext.servlet, class: HttpRequestParametersHashModel

Package freemarker.ext.servlet

# Class HttpRequestParametersHashModel

java.lang.Object
freemarker.ext.servlet.HttpRequestParametersHashModel

All Implemented Interfaces:
  `TemplateHashModel`, `TemplateHashModelEx`, `TemplateModel`

public class HttpRequestParametersHashModel extends Object implements TemplateHashModelEx
TemplateHashModel wrapper for a HttpServletRequest parameters.

Note that there are two variants of this class: One for the legacy "javax" Servlet API in the `freemarker.ext``.servlet` package, and another for the newer Jakarta Servlet API in the `freemarker.ext``.jakarta.servlet` package (since 2.3.33). Use the variant that fits your Servlet container!

- ## Field Summary

  ### Fields inherited from interface freemarker.template.TemplateModel

  `NOTHING`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `HttpRequestParametersHashModel​(javax.servlet.http.HttpServletRequest request)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TemplateModel`
  `get​(String key)`
  Gets a `TemplateModel` from the hash.
  `boolean`
  `isEmpty()`
  `TemplateCollectionModel`
  `keys()`
  `int`
  `size()`
  `protected String`
  `transcode​(String string)`
  `TemplateCollectionModel`
  `values()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### HttpRequestParametersHashModel

    public HttpRequestParametersHashModel​(javax.servlet.http.HttpServletRequest request)

- ## Method Details

  - ### get

    public TemplateModel get​(String key)
    Description copied from interface: `TemplateHashModel`
    Gets a `TemplateModel` from the hash.
    Specified by:
      `get` in interface `TemplateHashModel`
    Parameters:
      `key` - The name by which the `TemplateModel` is identified in the template.
    Returns:
      The `TemplateModel` referred to by the key, or `null` if not found.

  - ### isEmpty

    public boolean isEmpty()
    Specified by:
      `isEmpty` in interface `TemplateHashModel`

  - ### size

    public int size()
    Specified by:
      `size` in interface `TemplateHashModelEx`
    Returns:
      the number of key/value mappings in the hash.

  - ### keys

    public TemplateCollectionModel keys()
    Specified by:
      `keys` in interface `TemplateHashModelEx`
    Returns:
      a collection containing the keys in the hash. Every element of the returned collection must implement the `TemplateScalarModel` (as the keys of hashes are always strings).

  - ### values

    public TemplateCollectionModel values()
    Specified by:
      `values` in interface `TemplateHashModelEx`
    Returns:
      a collection containing the values in the hash. The elements of the returned collection can be any kind of `TemplateModel`-s.

  - ### transcode

    protected String transcode​(String string)