Package: grails.rest.render.util

## [Groovy] Class AbstractLinkingRenderer<T>

- grails.rest.render.util.AbstractLinkingRenderer

-     @groovy.transform.CompileStatic
      abstract class AbstractLinkingRenderer<T>
      extends AbstractIncludeExcludeRenderer<T>

  Abstract base class for HAL renderers

  Authors:
    Graeme Rocher
  Since:
    2.3

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected static java.util.List<java.lang.String>` | `DEFAULT_EXCLUDES` |
    `static java.lang.String` | `DEPRECATED_ATTRIBUTE` |
    `static java.lang.String` | `HREFLANG_ATTRIBUTE` |
    `static java.lang.String` | `HREF_ATTRIBUTE` |
    `static java.lang.String` | `RELATIONSHIP_SELF` |
    `static java.lang.String` | `TEMPLATED_ATTRIBUTE` |
    `static java.lang.String` | `TITLE_ATTRIBUTE` |
    `static java.lang.String` | `TYPE_ATTRIBUTE` |
    `private boolean` | `absoluteLinks` |
    `private java.lang.String` | `encoding` |
    `private org.grails.web.gsp.io.GrailsConventionGroovyPageLocator` | `groovyPageLocator` |
    `private LinkGenerator` | `linkGenerator` |
    `private org.grails.datastore.mapping.model.MappingContext` | `mappingContext` |
    `private org.springframework.context.MessageSource` | `messageSource` |
    `private boolean` | `prettyPrint` |
    `private ProxyHandler` | `proxyHandler` |
    `private RendererRegistry` | `rendererRegistry` |

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `boolean` | `absoluteLinks`
    `java.lang.String` | `encoding`
    `org.grails.web.gsp.io.GrailsConventionGroovyPageLocator` | `groovyPageLocator`
    `LinkGenerator` | `linkGenerator`
    `org.grails.datastore.mapping.model.MappingContext` | `mappingContext`
    `org.springframework.context.MessageSource` | `messageSource`
    `boolean` | `prettyPrint`
    `ProxyHandler` | `proxyHandler`
    `RendererRegistry` | `rendererRegistry`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `AbstractLinkingRenderer (java.lang.Class<T> targetType, MimeType mimeType)`
    `AbstractLinkingRenderer (java.lang.Class<T> targetType, MimeType[] mimeTypes)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected java.lang.String` | `getLinkTitle(org.grails.datastore.mapping.model.PersistentEntity entity, java.util.Locale locale)`
    `` | `java.util.Collection<Link>` | `getLinksForObject(java.lang.Object object)`
    `` | `protected java.lang.String` | `getResourceTitle(java.lang.String uri, java.util.Locale locale)`
    `` | `protected boolean` | `isDomainResource(java.lang.Class clazz)`
    `` | `final void` | `render(T object, RenderContext context)`
    `` | `abstract void` | `renderInternal(T object, RenderContext context)`
    `` | `protected java.util.Map<org.grails.datastore.mapping.model.types.Association, java.lang.Object>` | `writeAssociationLinks(RenderContext context, java.lang.Object object, java.util.Locale locale, java.lang.Object writer, org.grails.datastore.mapping.model.PersistentEntity entity, groovy.lang.MetaClass metaClass)`
    `` | `protected void` | `writeDomain(RenderContext context, groovy.lang.MetaClass metaClass, org.grails.datastore.mapping.model.PersistentEntity entity, java.lang.Object object, java.lang.Object writer)` Writes a domain instance
    `` | `protected abstract void` | `writeDomainProperty(java.lang.Object value, java.lang.String propertyName, java.lang.Object writer)`
    `` | `protected void` | `writeExtraLinks(java.lang.Object object, java.util.Locale locale, java.lang.Object writer)`
    `` | `protected abstract void` | `writeLink(Link link, java.util.Locale locale, java.lang.Object writerObject)`

- - ### Field Detail

    - #### protected static java.util.List<java.lang.String> DEFAULT_EXCLUDES

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

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

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

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

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

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

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

    - #### private boolean absoluteLinks

    - #### private java.lang.String encoding

    - #### @org.springframework.beans.factory.annotation.Autowired(required: false) private org.grails.web.gsp.io.GrailsConventionGroovyPageLocator groovyPageLocator

    - #### @org.springframework.beans.factory.annotation.Autowired private LinkGenerator linkGenerator

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

    - #### @org.springframework.beans.factory.annotation.Autowired private org.springframework.context.MessageSource messageSource

    - #### private boolean prettyPrint

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

    - #### @org.springframework.beans.factory.annotation.Autowired private RendererRegistry rendererRegistry

  - ### Property Detail

    - #### boolean absoluteLinks

    - #### java.lang.String encoding

    - #### @org.springframework.beans.factory.annotation.Autowired(required: false) org.grails.web.gsp.io.GrailsConventionGroovyPageLocator groovyPageLocator

    - #### @org.springframework.beans.factory.annotation.Autowired LinkGenerator linkGenerator

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

    - #### @org.springframework.beans.factory.annotation.Autowired org.springframework.context.MessageSource messageSource

    - #### boolean prettyPrint

    - #### @org.springframework.beans.factory.annotation.Autowired(required: false) ProxyHandler proxyHandler

    - #### @org.springframework.beans.factory.annotation.Autowired RendererRegistry rendererRegistry

  - ### Constructor Detail

    - #### AbstractLinkingRenderer(java.lang.Class<T> targetType, MimeType mimeType)

    - #### AbstractLinkingRenderer(java.lang.Class<T> targetType, MimeType[] mimeTypes)

  - ### Method Detail

    - #### protected java.lang.String getLinkTitle(org.grails.datastore.mapping.model.PersistentEntity entity, java.util.Locale locale)

    - #### @groovy.transform.CompileStatic(value: TypeCheckingMode.SKIP) java.util.Collection<Link> getLinksForObject(java.lang.Object object)

    - #### protected java.lang.String getResourceTitle(java.lang.String uri, java.util.Locale locale)

    - #### protected boolean isDomainResource(java.lang.Class clazz)

    - #### @java.lang.Override final void render(T object, RenderContext context)

    - #### abstract void renderInternal(T object, RenderContext context)

    - #### protected java.util.Map<org.grails.datastore.mapping.model.types.Association, java.lang.Object> writeAssociationLinks(RenderContext context, java.lang.Object object, java.util.Locale locale, java.lang.Object writer, org.grails.datastore.mapping.model.PersistentEntity entity, groovy.lang.MetaClass metaClass)

    - #### protected void writeDomain(RenderContext context, groovy.lang.MetaClass metaClass, org.grails.datastore.mapping.model.PersistentEntity entity, java.lang.Object object, java.lang.Object writer)

      Writes a domain instance

      Parameters:
        `clazz` - The class
        `object` - The object
        `writer` - The writer
      Returns:
        Any associations embedded within the object

    - #### protected abstract void writeDomainProperty(java.lang.Object value, java.lang.String propertyName, java.lang.Object writer)

    - #### protected void writeExtraLinks(java.lang.Object object, java.util.Locale locale, java.lang.Object writer)

    - #### protected abstract void writeLink(Link link, java.util.Locale locale, java.lang.Object writerObject)