public class ProtobufDataFormat
extends org.apache.camel.support.ServiceSupport
implements org.apache.camel.spi.DataFormat, org.apache.camel.spi.DataFormatName, org.apache.camel.CamelContextAware
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_TYPE_FORMAT_JSON |
static String |
CONTENT_TYPE_FORMAT_NATIVE |
Constructor and Description |
---|
ProtobufDataFormat() |
ProtobufDataFormat(com.google.protobuf.Message defaultInstance) |
ProtobufDataFormat(com.google.protobuf.Message defaultInstance,
String contentTypeFormat) |
Modifier and Type | Method and Description |
---|---|
protected void |
doStart() |
protected void |
doStop() |
org.apache.camel.CamelContext |
getCamelContext() |
String |
getDataFormatName() |
boolean |
isContentTypeHeader() |
protected com.google.protobuf.Message |
loadDefaultInstance(String className,
org.apache.camel.CamelContext context) |
void |
marshal(org.apache.camel.Exchange exchange,
Object graph,
OutputStream outputStream) |
void |
setCamelContext(org.apache.camel.CamelContext camelContext) |
void |
setContentTypeFormat(String contentTypeFormat) |
void |
setContentTypeHeader(boolean contentTypeHeader) |
void |
setDefaultInstance(com.google.protobuf.Message instance) |
void |
setDefaultInstance(Object instance) |
void |
setInstanceClass(String className) |
Object |
unmarshal(org.apache.camel.Exchange exchange,
InputStream inputStream) |
public static final String CONTENT_TYPE_FORMAT_NATIVE
public static final String CONTENT_TYPE_FORMAT_JSON
public ProtobufDataFormat()
public ProtobufDataFormat(com.google.protobuf.Message defaultInstance)
public ProtobufDataFormat(com.google.protobuf.Message defaultInstance, String contentTypeFormat)
public String getDataFormatName()
getDataFormatName
in interface org.apache.camel.spi.DataFormatName
public org.apache.camel.CamelContext getCamelContext()
getCamelContext
in interface org.apache.camel.CamelContextAware
public void setCamelContext(org.apache.camel.CamelContext camelContext)
setCamelContext
in interface org.apache.camel.CamelContextAware
public void setDefaultInstance(com.google.protobuf.Message instance)
public void setDefaultInstance(Object instance)
public void setContentTypeHeader(boolean contentTypeHeader)
public boolean isContentTypeHeader()
public void setContentTypeFormat(String contentTypeFormat)
public void marshal(org.apache.camel.Exchange exchange, Object graph, OutputStream outputStream) throws Exception
marshal
in interface org.apache.camel.spi.DataFormat
Exception
public Object unmarshal(org.apache.camel.Exchange exchange, InputStream inputStream) throws Exception
unmarshal
in interface org.apache.camel.spi.DataFormat
Exception
protected com.google.protobuf.Message loadDefaultInstance(String className, org.apache.camel.CamelContext context) throws org.apache.camel.CamelException, ClassNotFoundException
org.apache.camel.CamelException
ClassNotFoundException
protected void doStart() throws Exception
doStart
in class org.apache.camel.support.ServiceSupport
Exception
Apache Camel