@groovy.transform.CompileStatic class DefaultHalViewHelper extends DefaultJsonViewHelper
Helps creating HAL links
Modifiers | Name | Description |
---|---|---|
static class |
DefaultHalViewHelper.HalStreamingJsonDelegate |
Modifiers | Name | Description |
---|---|---|
static java.lang.String |
EMBEDDED_ATTRIBUTE |
|
static java.lang.String |
EMBEDDED_PARAMETER |
|
static java.lang.String |
HREFLANG_ATTRIBUTE |
|
static java.lang.String |
HREF_ATTRIBUTE |
|
static java.lang.String |
LINKS_ATTRIBUTE |
|
static java.lang.String |
SELF_ATTRIBUTE |
|
static java.lang.String |
TYPE_ATTRIBUTE |
Fields inherited from class | Fields |
---|---|
class DefaultJsonViewHelper |
NULL_OUTPUT, PAGINATION_MAX, PAGINATION_OFFSET, PAGINATION_ORDER, PAGINATION_RESROUCE, PAGINATION_SORT, PAGINATION_TOTAL, TO_STRING_TYPES |
Type | Name and description |
---|---|
java.lang.String |
contentType |
GrailsJsonViewHelper |
viewHelper |
Constructor and description |
---|
DefaultHalViewHelper
(JsonView view, GrailsJsonViewHelper viewHelper) |
Type | Name and description |
---|---|
protected groovy.lang.Closure<java.lang.Void> |
createlinksRenderingClosure(java.util.Map<java.lang.String, java.lang.Object> arguments = [:]) |
void |
embedded(java.lang.Object object, java.util.Map arguments = [:]) Renders embedded associations for the given entity |
void |
embedded(java.util.Map model) Render the given embedded objects |
void |
embedded(groovy.lang.Closure callable) Outputs a HAL embedded entry for the given closure |
void |
embedded(java.lang.String contentType, groovy.lang.Closure callable) Outputs a HAL embedded entry for the content type and closure |
void |
inline(java.lang.Object object, java.util.Map arguments = [:], groovy.lang.Closure customizer = null) |
void |
inline(java.lang.Object object, groovy.lang.Closure customizer) |
void |
links(groovy.lang.Closure callable) Define the hal links |
void |
links(java.lang.Object object, java.lang.String contentType = this.contentType) Creates HAL links for the given object |
void |
links(java.util.Map model, java.lang.Object paginationObject, java.lang.Number total, java.lang.String contentType = this.contentType) |
void |
links(java.util.Map model, java.lang.String contentType = this.contentType) |
void |
paginate(java.lang.Object object, java.lang.Integer total, java.lang.Integer offset = null, java.lang.Integer max = null, java.lang.String sort = null, java.lang.String order = null) Pagination support which outputs hal links to the resulting pages |
JsonWritable |
render(java.lang.Object object, java.util.Map arguments, groovy.lang.Closure customizer) Same as GrailsJsonViewHelper#render(java.lang.Object, java.util.Map, groovy.lang.Closure) but renders HAL links too |
JsonWritable |
render(java.lang.Object object, java.util.Map arguments) |
JsonWritable |
render(java.lang.Object object, groovy.lang.Closure customizer) Same as GrailsJsonViewHelper#render(java.lang.Object, java.util.Map, groovy.lang.Closure) but renders HAL links too |
JsonWritable |
render(java.lang.Object object) |
protected void |
renderEntityProperties(org.grails.datastore.mapping.model.PersistentEntity entity, java.lang.Object instance, org.grails.datastore.mapping.reflect.EntityReflector entityReflector, StreamingJsonDelegate associationJsonDelegate) |
protected void |
renderProperty(java.lang.Object embeddedObject, org.grails.datastore.mapping.model.PersistentProperty prop, org.grails.datastore.mapping.reflect.EntityReflector associationReflector, StreamingJsonDelegate jsonDelegate) |
void |
setDelegate(StreamingJsonDelegate jsonDelegate) |
void |
type(java.lang.String name) @param name Sets the HAL response type |
protected void |
writeLinks(StreamingJsonDelegate jsonDelegate, java.lang.Object object, java.lang.String contentType) |
Methods inherited from class | Name |
---|---|
class DefaultJsonViewHelper |
buildPaginateParams, defaultPaginateParams, findEntity, getExcludes, getExpandProperties, getGenerator, getGenericType, getIncludes, getJsonStackTrace, getLastOffset, getNextOffset, getPaginationLinks, getPaginationLinks, getPrevOffset, getRenderNulls, includeAssociations, isSimpleType, isStringType, paramsWithOffset |
class DefaultGrailsViewHelper |
ensureAbsolute, getContextPath, getLinkGenerator, getServerBaseURL, link, link, message, resource |
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() |
Renders embedded associations for the given entity
object
- The objectarguments
- Any arguments. Supported arguments: 'includes', 'excludes', 'deep'Render the given embedded objects
model
- The embedded modelOutputs a HAL embedded entry for the given closure
callable
- The callableOutputs a HAL embedded entry for the content type and closure
callable
- The callableDefine the hal links
callable
- The closureCreates HAL links for the given object
object
- The object to create links forPagination support which outputs hal links to the resulting pages
object
- The object to create links fortotal
- The total number of objects to be paginatedoffset
- The numerical offset where the page starts (defaults to 0)max
- The maximum number of objects to be shown (defaults to 10)sort
- The field to sort on (defaults to null)order
- The order in which the results are to be sorted eg: DESC or ASCSame as GrailsJsonViewHelper#render(java.lang.Object, java.util.Map, groovy.lang.Closure) but renders HAL links too
Same as GrailsJsonViewHelper#render(java.lang.Object, java.util.Map, groovy.lang.Closure) but renders HAL links too
name
- Sets the HAL response typeGroovy Documentation