DefaultLinkGenerator (Grails 6.0.0)

Package: org.grails.web.mapping

## [Groovy] Class DefaultLinkGenerator

- org.grails.web.mapping.DefaultLinkGenerator

- All Implemented Interfaces and Traits:
    LinkGenerator, PluginManagerAware

      @groovy.transform.CompileStatic
      @groovy.util.logging.Slf4j
      class DefaultLinkGenerator
      extends java.lang.Object
      implements LinkGenerator, PluginManagerAware

  A link generating service for applications to use when generating links.

  Authors:
    Graeme Rocher
  Since:
    2.0

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `private static java.util.regex.Pattern` | `absoluteUrlPattern` |
    `private java.lang.String` | `configuredServerBaseURL` |
    `private java.lang.String` | `contextPath` |
    `private UrlConverter` | `grailsUrlConverter` |
    `private org.grails.datastore.mapping.model.MappingContext` | `mappingContext` |
    `private GrailsPluginManager` | `pluginManager` |
    `private GrailsRequestStateLookupStrategy` | `requestStateLookupStrategy` |
    `private java.lang.String` | `resourcePath` |
    `private java.lang.String` | `resourcePattern` |
    `private UrlMappingsHolder` | `urlMappingsHolder` |

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `java.lang.String` | `configuredServerBaseURL`
    `java.lang.String` | `contextPath`
    `UrlConverter` | `grailsUrlConverter`
    `org.grails.datastore.mapping.model.MappingContext` | `mappingContext`
    `GrailsPluginManager` | `pluginManager`
    `GrailsRequestStateLookupStrategy` | `requestStateLookupStrategy`
    `java.lang.String` | `resourcePath`
    `java.lang.String` | `resourcePattern`
    `UrlMappingsHolder` | `urlMappingsHolder`

  - ### Constructor Summary

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

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `java.lang.String` | `getContextPath()`
    `` | `protected java.lang.String` | `getResourceId(java.lang.Object resourceAttribute)`
    `` | `java.lang.String` | `getServerBaseURL()`
    `` | `private java.lang.Object` | `handleAbsolute(java.util.Map attrs)` Check for "absolute" attribute and render server URL if available from Config or deducible in non-production.
    `` | `void` | `initializeResourcePath()`
    `` | `protected boolean` | `isAbsolute(java.util.Map attrs)`
    `` | `private boolean` | `isUriAbsolute(java.lang.String uri)`
    `` | `java.lang.String` | `link(java.util.Map attrs, java.lang.String encoding)` {@inheritDoc}
    `` | `java.lang.String` | `makeServerURL()` Get the declared URL of the server from config, or guess at localhost for non-production.
    `` | `java.lang.String` | `resource(java.util.Map attrs)` { inheritDoc: }
    `` | `void` | `setPluginManager(GrailsPluginManager pluginManager)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Field Detail

    - #### private static final java.util.regex.Pattern absoluteUrlPattern

    - #### private java.lang.String configuredServerBaseURL

    - #### private java.lang.String contextPath

    - #### @org.springframework.beans.factory.annotation.Autowired(required: false) private UrlConverter grailsUrlConverter

    - #### @org.springframework.beans.factory.annotation.Autowired(required: false) @org.springframework.beans.factory.annotation.Qualifier(value: grailsDomainClassMappingContext) private org.grails.datastore.mapping.model.MappingContext mappingContext

    - #### private GrailsPluginManager pluginManager

    - #### private GrailsRequestStateLookupStrategy requestStateLookupStrategy

    - #### private java.lang.String resourcePath

    - #### @org.springframework.beans.factory.annotation.Value(value: ${grails.resources.pattern:/static/**}) private java.lang.String resourcePattern

    - #### @org.springframework.beans.factory.annotation.Autowired @org.springframework.beans.factory.annotation.Qualifier(value: grailsUrlMappingsHolder) private UrlMappingsHolder urlMappingsHolder

  - ### Property Detail

    - #### java.lang.String configuredServerBaseURL

    - #### java.lang.String contextPath

    - #### @org.springframework.beans.factory.annotation.Autowired(required: false) UrlConverter grailsUrlConverter

    - #### @org.springframework.beans.factory.annotation.Autowired(required: false) @org.springframework.beans.factory.annotation.Qualifier(value: grailsDomainClassMappingContext) org.grails.datastore.mapping.model.MappingContext mappingContext

    - #### GrailsPluginManager pluginManager

    - #### GrailsRequestStateLookupStrategy requestStateLookupStrategy

    - #### java.lang.String resourcePath

    - #### @org.springframework.beans.factory.annotation.Value(value: ${grails.resources.pattern:/static/**}) java.lang.String resourcePattern

    - #### @org.springframework.beans.factory.annotation.Autowired @org.springframework.beans.factory.annotation.Qualifier(value: grailsUrlMappingsHolder) UrlMappingsHolder urlMappingsHolder

  - ### Constructor Detail

    - #### DefaultLinkGenerator(java.lang.String serverBaseURL, java.lang.String contextPath)

    - #### DefaultLinkGenerator(java.lang.String serverBaseURL)

  - ### Method Detail

    - #### java.lang.String getContextPath()

    - #### @groovy.transform.CompileStatic(value: TypeCheckingMode.SKIP) protected java.lang.String getResourceId(java.lang.Object resourceAttribute)

    - #### java.lang.String getServerBaseURL()

    - #### private java.lang.Object handleAbsolute(java.util.Map attrs)

      Check for "absolute" attribute and render server URL if available from Config or deducible in non-production.

    - #### @javax.annotation.PostConstruct void initializeResourcePath()

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

    - #### private boolean isUriAbsolute(java.lang.String uri)

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

      {@inheritDoc}

    - #### java.lang.String makeServerURL()

      Get the declared URL of the server from config, or guess at localhost for non-production.

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

      {

      inheritDoc:
        }

    - #### void setPluginManager(GrailsPluginManager pluginManager)