public abstract static class Jackson.Init extends Object
Use of these methods are not required at all if using the Guice integration and JacksonModule
.
Constructor and Description |
---|
Init() |
Modifier and Type | Method and Description |
---|---|
static Parser<NullParseOpts> |
noOptParser()
The no-opts parser.
|
static Parser<JsonParseOpts> |
parser(ObjectMapper objectMapper)
The parser.
|
static RegistrySpec |
register(RegistrySpec registrySpec,
ObjectMapper objectMapper,
ObjectWriter objectWriter)
Registers the renderer and parsers with the given registry.
|
static Renderer<JsonRender> |
renderer(ObjectWriter objectWriter)
The renderer.
|
public static Renderer<JsonRender> renderer(ObjectWriter objectWriter)
objectWriter
- the object writer to use to render objectpublic static Parser<NullParseOpts> noOptParser()
public static Parser<JsonParseOpts> parser(ObjectMapper objectMapper)
objectMapper
- the object mapper to use for parsingpublic static RegistrySpec register(RegistrySpec registrySpec, ObjectMapper objectMapper, ObjectWriter objectWriter)
If using Jackson support without Guice and the JacksonModule
, this method should be used to register the renderer and parsers with the context registry.
Use of this method is not necessary if using JacksonModule
as it makes the renderer and parsers available.
registrySpec
- the registry to register withobjectMapper
- the object mapper for parsing requestsobjectWriter
- the object writer for rendering to responses