CachingLinkGenerator (Grails 6.0.0)

Package: org.grails.web.mapping

## [Java] Class CachingLinkGenerator

- org.grails.web.mapping.CachingLinkGenerator

-     @java.lang.SuppressWarnings("rawtypes")
      public class CachingLinkGenerator
      extends DefaultLinkGenerator

  A link generator that uses a LRU cache to cache generated links.

  Since:
    2.0
  Authors:
    Graeme Rocher

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `private static java.lang.String` | `CLOSING_BRACKET` |
    `private static java.lang.String` | `COMMA_SEPARATOR` |
    `static java.lang.String` | `EMPTY_MAP_STRING` |
    `private static java.lang.String` | `KEY_VALUE_SEPARATOR` |
    `static java.lang.String` | `LINK_PREFIX` |
    `private static int` | `MAX_SIZE` |
    `private static java.lang.String` | `OPENING_BRACKET` |
    `static java.lang.String` | `RESOURCE_PREFIX` |
    `private static java.lang.String` | `THIS_MAP` |
    `static java.lang.String` | `USED_ATTRIBUTES_SUFFIX` |
    `private com.github.benmanes.caffeine.cache.Cache<java.lang.String, java.lang.Object>` | `linkCache` |

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class DefaultLinkGenerator` | `absoluteUrlPattern, configuredServerBaseURL, contextPath, grailsUrlConverter, mappingContext, pluginManager, requestStateLookupStrategy, resourcePath, resourcePattern, urlMappingsHolder`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `CachingLinkGenerator (java.lang.String serverBaseURL, java.lang.String contextPath)`
    `CachingLinkGenerator (java.lang.String serverBaseURL)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `private boolean` | `appendCommaIfNotFirst(java.lang.StringBuilder buffer, boolean first)`
    `` | `protected void` | `appendKeyValue(java.lang.StringBuilder buffer, java.util.Map map, java.lang.Object key, java.lang.Object value)`
    `` | `protected void` | `appendMapKey(java.lang.StringBuilder buffer, java.util.Map<java.lang.String, java.lang.Object> params)`
    `` | `public void` | `clearCache()`
    `` | `private com.github.benmanes.caffeine.cache.Cache<java.lang.String, java.lang.Object>` | `createDefaultCache()`
    `` | `protected java.lang.String` | `getCacheKeyValueForResource(java.lang.Object o)`
    `` | `protected boolean` | `isCacheable(java.util.Map attrs)`
    `` | `public java.lang.String` | `link(java.util.Map attrs, java.lang.String encoding)`
    `` | `protected java.lang.String` | `makeKey(java.lang.String prefix, java.util.Map attrs)`
    `` | `public java.lang.String` | `resource(java.util.Map attrs)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class DefaultLinkGenerator` | `getContextPath, getResourceId, getServerBaseURL, handleAbsolute, initializeResourcePath, isAbsolute, isUriAbsolute, link, makeServerURL, resource, setPluginManager`

- - ### Field Detail

    - #### private static final java.lang.String CLOSING_BRACKET

    - #### private static final java.lang.String COMMA_SEPARATOR

    - #### public static final java.lang.String EMPTY_MAP_STRING

    - #### private static final java.lang.String KEY_VALUE_SEPARATOR

    - #### public static final java.lang.String LINK_PREFIX

    - #### private static final int MAX_SIZE

    - #### private static final java.lang.String OPENING_BRACKET

    - #### public static final java.lang.String RESOURCE_PREFIX

    - #### private static final java.lang.String THIS_MAP

    - #### public static final java.lang.String USED_ATTRIBUTES_SUFFIX

    - #### private com.github.benmanes.caffeine.cache.Cache<java.lang.String, java.lang.Object> linkCache

  - ### Constructor Detail

    - #### public CachingLinkGenerator(java.lang.String serverBaseURL, java.lang.String contextPath)

    - #### public CachingLinkGenerator(java.lang.String serverBaseURL)

  - ### Method Detail

    - #### private boolean appendCommaIfNotFirst(java.lang.StringBuilder buffer, boolean first)

    - #### protected void appendKeyValue(java.lang.StringBuilder buffer, java.util.Map map, java.lang.Object key, java.lang.Object value)

    - #### protected void appendMapKey(java.lang.StringBuilder buffer, java.util.Map<java.lang.String, java.lang.Object> params)

    - #### public void clearCache()

    - #### private com.github.benmanes.caffeine.cache.Cache<java.lang.String, java.lang.Object> createDefaultCache()

    - #### protected java.lang.String getCacheKeyValueForResource(java.lang.Object o)

    - #### protected boolean isCacheable(java.util.Map attrs)

    - #### @java.lang.Override public java.lang.String link(java.util.Map attrs, java.lang.String encoding)

    - #### protected java.lang.String makeKey(java.lang.String prefix, java.util.Map attrs)

    - #### @java.lang.Override public java.lang.String resource(java.util.Map attrs)