@CompileStatic class DefaultHalViewHelper extends DefaultJsonViewHelper implements HalViewHelper
Helps creating HAL links
| Modifiers | Name | Description |
|---|---|---|
class |
DefaultHalViewHelper.1 |
|
static class |
DefaultHalViewHelper.HalStreamingJsonDelegate |
| Modifiers | Name | Description |
|---|---|---|
static String |
EMBEDDED_ATTRIBUTE |
|
static String |
EMBEDDED_PARAMETER |
|
static String |
HREFLANG_ATTRIBUTE |
|
static String |
HREF_ATTRIBUTE |
|
static String |
LINKS_ATTRIBUTE |
|
static String |
SELF_ATTRIBUTE |
|
static String |
TYPE_ATTRIBUTE |
| Fields inherited from class | Fields |
|---|---|
class DefaultJsonViewHelper |
DEFAULT_EXCLUDES, DEFAULT_GORM_EXCLUDES, DEFAULT_VALIDATEABLE_EXCLUDES, PAGINATION_MAX, PAGINATION_OFFSET, PAGINATION_ORDER, PAGINATION_RESROUCE, PAGINATION_SORT, PAGINATION_TOTAL, TO_STRING_TYPES |
| Type | Name and description |
|---|---|
String |
contentType |
GrailsJsonViewHelper |
viewHelper |
| Properties inherited from class | Properties |
|---|---|
class DefaultJsonViewHelper |
ASSOCIATIONS, EXPAND, includeExcludeSupport, simpleIncludeExcludeSupport, validateableIncludeExcludeSupport |
class DefaultGrailsViewHelper |
view |
| Constructor and description |
|---|
DefaultHalViewHelper(JsonView view, GrailsJsonViewHelper viewHelper) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected Closure<Void> |
createlinksRenderingClosure(Map<String, Object> arguments) |
|
void |
embedded(Object object, Map arguments)Renders embedded associations for the given entity |
|
void |
embedded(Map model)Render the given embedded objects |
|
void |
embedded(Closure callable)Outputs a HAL embedded entry for the given closure |
|
void |
embedded(String contentType, Closure callable)Outputs a HAL embedded entry for the content type and closure |
|
void |
inline(Object object, Map arguments, Closure customizer) |
|
void |
inline(Object object, Closure customizer) |
|
void |
links(Closure callable)Define the hal links |
|
void |
links(Object object, String contentType)Creates HAL links for the given object |
|
void |
links(Map model, Object paginationObject, Number total, String contentType) |
|
void |
links(Map model, String contentType) |
|
void |
paginate(Object object, Integer total, Integer offset, Integer max, String sort, String order) |
|
JsonWritable |
render(Object object, Map arguments, Closure customizer)Same as GrailsJsonViewHelper#render(java.lang.Object, java.util.Map, groovy.lang.Closure) but renders HAL links too |
|
JsonWritable |
render(Object object, Map arguments) |
|
JsonWritable |
render(Object object, Closure customizer)Same as GrailsJsonViewHelper#render(java.lang.Object, java.util.Map, groovy.lang.Closure) but renders HAL links too |
|
JsonWritable |
render(Object object) |
|
protected void |
renderEntityProperties(PersistentEntity entity, Object instance, EntityReflector entityReflector, StreamingJsonBuilder.StreamingJsonDelegate associationJsonDelegate) |
|
protected void |
renderProperty(Object embeddedObject, PersistentProperty prop, EntityReflector associationReflector, StreamingJsonBuilder.StreamingJsonDelegate jsonDelegate) |
|
void |
setDelegate(StreamingJsonBuilder.StreamingJsonDelegate jsonDelegate) |
|
void |
type(String name)
|
|
protected void |
writeLinks(StreamingJsonBuilder.StreamingJsonDelegate jsonDelegate, Object object, 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 |
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 callableCreates HAL links for the given object
object - The object to create links forSame 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