@Dataformat(value="json-johnzon")
@Metadata(includeProperties="unmarshalType,unmarshalTypeName,objectMapper,prettyPrint")
public class JohnzonDataFormat
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.spi.DataFormat, org.apache.camel.spi.DataFormatName, org.apache.camel.CamelContextAware
| Constructor and Description |
|---|
JohnzonDataFormat() |
JohnzonDataFormat(Class<?> unmarshalType)
Use the default Johnzon
Mapper and with a custom unmarshal type |
JohnzonDataFormat(org.apache.johnzon.mapper.reflection.JohnzonParameterizedType parameterizedType)
Use the default Johnzon
Mapper and with a custom parameterized type |
JohnzonDataFormat(org.apache.johnzon.mapper.Mapper mapper,
Class<?> unmarshalType)
Use a custom Johnzon mapper and unmarshal type
|
JohnzonDataFormat(org.apache.johnzon.mapper.Mapper mapper,
org.apache.johnzon.mapper.reflection.JohnzonParameterizedType parameterizedType)
Use a custom Johnzon mapper and unmarshal type
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doInit() |
protected void |
doStart() |
protected void |
doStop() |
Comparator<String> |
getAttributeOrder() |
org.apache.camel.CamelContext |
getCamelContext() |
String |
getDataFormatName() |
String |
getEncoding() |
org.apache.johnzon.mapper.Mapper |
getObjectMapper() |
org.apache.johnzon.mapper.reflection.JohnzonParameterizedType |
getParameterizedType() |
Class<?> |
getUnmarshalType() |
String |
getUnmarshalTypeName() |
boolean |
isPrettyPrint() |
boolean |
isSkipEmptyArray() |
boolean |
isSkipNull() |
void |
marshal(org.apache.camel.Exchange exchange,
Object graph,
OutputStream stream) |
void |
setAttributeOrder(Comparator<String> attributeOrder) |
void |
setCamelContext(org.apache.camel.CamelContext camelContext) |
void |
setEncoding(String encoding) |
void |
setObjectMapper(org.apache.johnzon.mapper.Mapper objectMapper) |
void |
setParameterizedType(org.apache.johnzon.mapper.reflection.JohnzonParameterizedType parameterizedType) |
void |
setPrettyPrint(boolean prettyPrint) |
void |
setSkipEmptyArray(boolean skipEmptyArray) |
void |
setSkipNull(boolean skipNull) |
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 JohnzonDataFormat()
public JohnzonDataFormat(Class<?> unmarshalType)
Mapper and with a custom unmarshal typeunmarshalType - the custom unmarshal typepublic JohnzonDataFormat(org.apache.johnzon.mapper.reflection.JohnzonParameterizedType parameterizedType)
Mapper and with a custom parameterized typeparameterizedType - the custom parameterized typepublic JohnzonDataFormat(org.apache.johnzon.mapper.Mapper mapper,
Class<?> unmarshalType)
mapper - the custom mapperunmarshalType - the custom unmarshal typepublic JohnzonDataFormat(org.apache.johnzon.mapper.Mapper mapper,
org.apache.johnzon.mapper.reflection.JohnzonParameterizedType parameterizedType)
mapper - the custom mapperparameterizedType - the JohnzonParameterizedType typepublic void setCamelContext(org.apache.camel.CamelContext camelContext)
setCamelContext in interface org.apache.camel.CamelContextAwarepublic org.apache.camel.CamelContext getCamelContext()
getCamelContext in interface org.apache.camel.CamelContextAwarepublic String getDataFormatName()
getDataFormatName in interface org.apache.camel.spi.DataFormatNamepublic org.apache.johnzon.mapper.Mapper getObjectMapper()
public void setObjectMapper(org.apache.johnzon.mapper.Mapper objectMapper)
public Class<?> getUnmarshalType()
public void setUnmarshalType(Class<?> unmarshalType)
public String getUnmarshalTypeName()
public void setUnmarshalTypeName(String unmarshalTypeName)
public org.apache.johnzon.mapper.reflection.JohnzonParameterizedType getParameterizedType()
public void setParameterizedType(org.apache.johnzon.mapper.reflection.JohnzonParameterizedType parameterizedType)
public boolean isPrettyPrint()
public void setPrettyPrint(boolean prettyPrint)
public String getEncoding()
public void setEncoding(String encoding)
public boolean isSkipEmptyArray()
public void setSkipEmptyArray(boolean skipEmptyArray)
public boolean isSkipNull()
public void setSkipNull(boolean skipNull)
public Comparator<String> getAttributeOrder()
public void setAttributeOrder(Comparator<String> attributeOrder)
public 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.BaseServiceExceptionApache Camel