@Dataformat(value="json-fastjson")
@Metadata(includeProperties="unmarshalTypeName,prettyprint,contentTypeHeader")
public class FastjsonDataFormat
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.spi.DataFormat, org.apache.camel.spi.DataFormatName, org.apache.camel.spi.DataFormatContentTypeHeader, org.apache.camel.CamelContextAware
| 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 |
doInit() |
protected void |
doStart() |
protected void |
doStop() |
org.apache.camel.CamelContext |
getCamelContext() |
com.alibaba.fastjson.support.config.FastJsonConfig |
getConfig() |
String |
getDataFormatName() |
String |
getDateFormatPattern() |
Type |
getUnmarshalGenericType() |
Class<?> |
getUnmarshalType() |
String |
getUnmarshalTypeName() |
boolean |
isContentTypeHeader() |
boolean |
isPrettyPrint() |
boolean |
isSerializeNulls() |
void |
marshal(org.apache.camel.Exchange exchange,
Object graph,
OutputStream stream) |
void |
setCamelContext(org.apache.camel.CamelContext camelContext) |
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) |
void |
setUnmarshalTypeName(String unmarshalTypeName) |
Object |
unmarshal(org.apache.camel.Exchange exchange,
InputStream stream) |
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic 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 org.apache.camel.CamelContext getCamelContext()
getCamelContext in interface org.apache.camel.CamelContextAwarepublic void setCamelContext(org.apache.camel.CamelContext camelContext)
setCamelContext in interface org.apache.camel.CamelContextAwarepublic String getDataFormatName()
getDataFormatName in interface org.apache.camel.spi.DataFormatNamepublic void marshal(org.apache.camel.Exchange exchange,
Object graph,
OutputStream stream)
throws Exception
marshal in interface org.apache.camel.spi.DataFormatExceptionpublic Object unmarshal(org.apache.camel.Exchange exchange, InputStream stream) throws Exception
unmarshal in interface org.apache.camel.spi.DataFormatExceptionprotected void doInit()
throws Exception
doInit in class org.apache.camel.support.service.BaseServiceExceptionprotected void doStart()
throws Exception
doStart in class org.apache.camel.support.service.BaseServiceExceptionprotected void doStop()
throws Exception
doStop in class org.apache.camel.support.service.BaseServiceExceptionpublic Class<?> getUnmarshalType()
public void setUnmarshalType(Class<?> unmarshalType)
public String getUnmarshalTypeName()
public void setUnmarshalTypeName(String unmarshalTypeName)
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)
setContentTypeHeader in interface org.apache.camel.spi.DataFormatContentTypeHeaderpublic com.alibaba.fastjson.support.config.FastJsonConfig getConfig()
Apache Camel