public class FastjsonDataFormat
extends org.apache.camel.support.ServiceSupport
implements org.apache.camel.spi.DataFormat, org.apache.camel.spi.DataFormatName
Constructor and Description |
---|
FastjsonDataFormat() |
FastjsonDataFormat(Class<?> unmarshalType) |
FastjsonDataFormat(com.alibaba.fastjson.support.config.FastJsonConfig config,
Class<?> unmarshalType) |
FastjsonDataFormat(com.alibaba.fastjson.support.config.FastJsonConfig config,
Type unmarshalGenericType) |
FastjsonDataFormat(Type unmarshalGenericType) |
Modifier and Type | Method and Description |
---|---|
protected void |
doStart() |
protected void |
doStop() |
com.alibaba.fastjson.support.config.FastJsonConfig |
getConfig() |
String |
getDataFormatName() |
String |
getDateFormatPattern() |
Type |
getUnmarshalGenericType() |
Class<?> |
getUnmarshalType() |
boolean |
isContentTypeHeader() |
boolean |
isPrettyPrint() |
boolean |
isSerializeNulls() |
void |
marshal(org.apache.camel.Exchange exchange,
Object graph,
OutputStream stream) |
void |
setContentTypeHeader(boolean contentTypeHeader)
If enabled then JSON will set the Content-Type header to application/json when marshalling.
|
void |
setDateFormatPattern(String dateFormatPattern) |
void |
setPrettyPrint(boolean prettyPrint) |
void |
setSerializeNulls(boolean serializeNulls) |
void |
setUnmarshalGenericType(Type unmarshalGenericType) |
void |
setUnmarshalType(Class<?> unmarshalType) |
Object |
unmarshal(org.apache.camel.Exchange exchange,
InputStream stream) |
public FastjsonDataFormat()
public FastjsonDataFormat(Class<?> unmarshalType)
public FastjsonDataFormat(com.alibaba.fastjson.support.config.FastJsonConfig config, Class<?> unmarshalType)
public FastjsonDataFormat(Type unmarshalGenericType)
public FastjsonDataFormat(com.alibaba.fastjson.support.config.FastJsonConfig config, Type unmarshalGenericType)
public String getDataFormatName()
getDataFormatName
in interface org.apache.camel.spi.DataFormatName
public void marshal(org.apache.camel.Exchange exchange, Object graph, OutputStream stream) throws Exception
marshal
in interface org.apache.camel.spi.DataFormat
Exception
public Object unmarshal(org.apache.camel.Exchange exchange, InputStream stream) throws Exception
unmarshal
in interface org.apache.camel.spi.DataFormat
Exception
protected void doStart() throws Exception
doStart
in class org.apache.camel.support.ServiceSupport
Exception
protected void doStop() throws Exception
doStop
in class org.apache.camel.support.ServiceSupport
Exception
public Class<?> getUnmarshalType()
public void setUnmarshalType(Class<?> unmarshalType)
public Type getUnmarshalGenericType()
public void setUnmarshalGenericType(Type unmarshalGenericType)
public boolean isSerializeNulls()
public void setSerializeNulls(boolean serializeNulls)
public boolean isPrettyPrint()
public void setPrettyPrint(boolean prettyPrint)
public String getDateFormatPattern()
public void setDateFormatPattern(String dateFormatPattern)
public boolean isContentTypeHeader()
public void setContentTypeHeader(boolean contentTypeHeader)
public com.alibaba.fastjson.support.config.FastJsonConfig getConfig()
Apache Camel