@CompileStatic class JsonViewGenerator extends DefaultJsonGenerator
The JsonGenerator of JSON views. It writes java.util.Date and java.util.Calendar map keys the same way as
those values, with the configured grails.views.json.generator.dateFormat, time zone and locale, and
java.time.ZonedDateTime map keys as JsonDateFormat.formatKey does, rather than with their
toString(), as Spring Boot's default Jackson rendering does. Keys that format to the same text are all
written, as Jackson writes them.
| Constructor and description |
|---|
JsonViewGenerator(JsonGenerator.Options options)
|
| Type Params | Return Type | Name and description |
|---|---|---|
|
java.lang.String |
formatMapKey(java.lang.Object key)
|
|
boolean |
hasDateTimeConverter(java.lang.Class<?> type)Whether values of the type are dates or times that one of the converters of this generator writes, such as the date and time converters of JSON views, so that g.render writes them as it writes other simple values.
|
|
protected void |
writeMap(java.util.Map<?, ?> map, CharBuf buffer) |
| Methods inherited from class | Name |
|---|---|
class DefaultJsonGenerator |
equals, getClass, hashCode, isExcludingFieldsNamed, isExcludingValues, notify, notifyAll, toJson, toString, wait, wait, wait |
options - the generator options
key - a non-null map key Whether values of the type are dates or times that one of the converters of this generator writes, such as the
date and time converters of JSON views, so that g.render writes them as it writes other simple values.
A converter that an application registers for any other type does not change how g.render renders it.
type - a value type