HalJsonRenderer (Grails 3.1.10)
Date: 2016-07-28

Package: grails.rest.render.hal

## [Groovy] Class HalJsonRenderer<T>

- grails.rest.render.hal.HalJsonRenderer

- Renders domain instances in HAL JSON format (see http://tools.ietf.org/html/draft-kelly-json-hal-05)

  Authors:
    Graeme Rocher
  Since:
    2.3

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static java.lang.String` | `EMBEDDED_ATTRIBUTE` |
    `static java.lang.String` | `LINKS_ATTRIBUTE` |
    `static MimeType` | `MIME_TYPE` |

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class AbstractLinkingRenderer` | `DEFAULT_EXCLUDES, DEPRECATED_ATTRIBUTE, HREFLANG_ATTRIBUTE, HREF_ATTRIBUTE, RELATIONSHIP_SELF, TEMPLATED_ATTRIBUTE, TITLE_ATTRIBUTE, TYPE_ATTRIBUTE`

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `java.lang.String` | `collectionName`
    `DataBindingSourceRegistry` | `dataBindingSourceRegistry`
    `org.springframework.core.convert.converter.Converter<java.util.Date, java.lang.String>` | `dateToStringConverter`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `HalJsonRenderer (java.lang.Class<T> targetType)`
    `HalJsonRenderer (java.lang.Class<T> targetType, MimeType... mimeTypes)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `initialize()`
    `protected java.lang.Object` | `renderEmbeddedAttributes(groovy.json.StreamingJsonBuilder$StreamingJsonDelegate writer, java.lang.Object object, RenderContext context, MimeType mimeType)`
    `void` | `renderInternal(T object, RenderContext context)`
    `void` | `setDateToStringConverter(org.springframework.core.convert.converter.Converter<java.util.Date, java.lang.String> converter)`
    `protected void` | `writeDomainProperty(java.lang.Object value, java.lang.String propertyName, java.lang.Object jsonWriter)`
    `protected void` | `writeDomainWithEmbeddedAndLinks(RenderContext context, java.lang.Class clazz, java.lang.Object object, groovy.json.StreamingJsonBuilder$StreamingJsonDelegate writer, java.util.Locale locale, MimeType contentType, java.util.Set writtenObjects, java.util.Stack referenceStack)`
    `protected void` | `writeLink(Link link, java.util.Locale locale, java.lang.Object writer)`
    `protected void` | `writeLinkForCurrentPath(RenderContext context, MimeType mimeType, groovy.json.StreamingJsonBuilder$StreamingJsonDelegate writer)`
    `protected java.util.Map<org.grails.datastore.mapping.model.types.Association, java.lang.Object>` | `writeLinks(RenderContext context, groovy.lang.MetaClass metaClass, java.lang.Object object, org.grails.datastore.mapping.model.PersistentEntity entity, java.util.Locale locale, MimeType contentType, groovy.json.StreamingJsonBuilder$StreamingJsonDelegate writer, boolean associationLinks = true)`
    `protected void` | `writeSimpleObject(java.lang.Object object, RenderContext context, groovy.json.StreamingJsonBuilder$StreamingJsonDelegate writer)`
    `protected java.lang.Object` | `writeSimpleObjectAndLink(java.lang.Object o, RenderContext context, groovy.json.StreamingJsonBuilder$StreamingJsonDelegate writer, MimeType mimeType)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class AbstractLinkingRenderer` | `getLinkTitle, getLinksForObject, getResourceTitle, isDomainResource, render, renderInternal, writeAssociationLinks, writeDomain, writeDomainProperty, writeExtraLinks, writeLink`
    `class AbstractIncludeExcludeRenderer` | `excludesProperty, includesProperty, shouldIncludeProperty`
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), 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

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

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

    - #### public static final MimeType MIME_TYPE

  - ### Property Detail

    - #### java.lang.String collectionName

    - #### @org.springframework.beans.factory.annotation.Autowired(required = false) DataBindingSourceRegistry dataBindingSourceRegistry

    - #### org.springframework.core.convert.converter.Converter<java.util.Date, java.lang.String> dateToStringConverter

  - ### Constructor Detail

    - #### HalJsonRenderer(java.lang.Class<T> targetType)

    - #### HalJsonRenderer(java.lang.Class<T> targetType, MimeType... mimeTypes)

  - ### Method Detail

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

    - #### protected java.lang.Object renderEmbeddedAttributes(groovy.json.StreamingJsonBuilder$StreamingJsonDelegate writer, java.lang.Object object, RenderContext context, MimeType mimeType)

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

    - #### @org.springframework.beans.factory.annotation.Autowired(required = false) void setDateToStringConverter(org.springframework.core.convert.converter.Converter<java.util.Date, java.lang.String> converter)

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

    - #### protected void writeDomainWithEmbeddedAndLinks(RenderContext context, java.lang.Class clazz, java.lang.Object object, groovy.json.StreamingJsonBuilder$StreamingJsonDelegate writer, java.util.Locale locale, MimeType contentType, java.util.Set writtenObjects, java.util.Stack referenceStack)

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

    - #### protected void writeLinkForCurrentPath(RenderContext context, MimeType mimeType, groovy.json.StreamingJsonBuilder$StreamingJsonDelegate writer)

    - #### protected java.util.Map<org.grails.datastore.mapping.model.types.Association, java.lang.Object> writeLinks(RenderContext context, groovy.lang.MetaClass metaClass, java.lang.Object object, org.grails.datastore.mapping.model.PersistentEntity entity, java.util.Locale locale, MimeType contentType, groovy.json.StreamingJsonBuilder$StreamingJsonDelegate writer, boolean associationLinks = true)

    - #### protected void writeSimpleObject(java.lang.Object object, RenderContext context, groovy.json.StreamingJsonBuilder$StreamingJsonDelegate writer)

    - #### protected java.lang.Object writeSimpleObjectAndLink(java.lang.Object o, RenderContext context, groovy.json.StreamingJsonBuilder$StreamingJsonDelegate writer, MimeType mimeType)