public interface

JsonRenderer

com.atlassian.stash.json.JsonRenderer

Class Overview

Renders an object to a JSON string. Used by Stash when a JSON representation of a model object is required, typically in its view layer. Service providers will not normally need to implement this interface.

Summary

Public Methods
@Nullable String render(Object object, Map<String, Object> options)
Renders an object to JSON given any supplied options.

Public Methods

@Nullable public String render (Object object, Map<String, Object> options)

Renders an object to JSON given any supplied options. If the renderer does not know how to render the supplied object to JSON or if an error is encountered while doing this then it should return null.

Parameters
object the object to render
options any options the renderer should take into consideration
Returns
  • null if unable to render the object to JSON