public class JacksonHelper extends Object implements org.springframework.beans.factory.InitializingBean
Modifier and Type | Class and Description |
---|---|
static class |
JacksonHelper.ReturnAllBeanProperties |
static interface |
JacksonHelper.Writer
A callback interface for use with the withWriter() method
|
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_FILTER_NAME |
Constructor and Description |
---|
JacksonHelper() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
<T> T |
construct(Reader content,
Class<T> requiredType)
Constructs the object based on the content.
|
<T> List<T> |
constructList(Reader content,
Class<T> requiredType)
Constructs the object based on the content as a List, the JSON can be an array or just a single value without the [] symbols
|
void |
setModule(org.codehaus.jackson.map.Module module)
Sets the Jackson Module to be used.
|
void |
withWriter(OutputStream outStream,
JacksonHelper.Writer writer)
A callback so a JsonGenerator can be used inline but exception are handled here
|
public static final String DEFAULT_FILTER_NAME
public void setModule(org.codehaus.jackson.map.Module module)
module
- Modulepublic void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public void withWriter(OutputStream outStream, JacksonHelper.Writer writer) throws IOException
outStream
- OutputStreamwriter
- The writer interfaceIOException
public <T> T construct(Reader content, Class<T> requiredType) throws IOException, org.codehaus.jackson.map.JsonMappingException, org.codehaus.jackson.JsonParseException
content
- ReaderIOException
org.codehaus.jackson.map.JsonMappingException
org.codehaus.jackson.JsonParseException
public <T> List<T> constructList(Reader content, Class<T> requiredType) throws IOException, org.codehaus.jackson.map.JsonMappingException, org.codehaus.jackson.JsonParseException
content
- ReaderIOException
org.codehaus.jackson.map.JsonMappingException
org.codehaus.jackson.JsonParseException
Copyright © 2005–2017 Alfresco Software. All rights reserved.