org.apache.camel.dataformat.protobuf
Class ProtobufDataFormat

java.lang.Object
  extended by org.apache.camel.dataformat.protobuf.ProtobufDataFormat
All Implemented Interfaces:
org.apache.camel.spi.DataFormat

public class ProtobufDataFormat
extends Object
implements org.apache.camel.spi.DataFormat


Constructor Summary
ProtobufDataFormat()
           
ProtobufDataFormat(com.google.protobuf.Message defaultInstance)
           
 
Method Summary
 com.google.protobuf.Message getInstance(org.apache.camel.Exchange exchange)
           
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 setDefaultInstace(com.google.protobuf.Message instance)
           
 void setDefaultInstance(Object instance)
           
 void setInstanceClass(String className)
           
 Object unmarshal(org.apache.camel.Exchange exchange, InputStream inputStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtobufDataFormat

public ProtobufDataFormat(com.google.protobuf.Message defaultInstance)
Parameters:
defaultInstance -

ProtobufDataFormat

public ProtobufDataFormat()
Method Detail

setDefaultInstace

public void setDefaultInstace(com.google.protobuf.Message instance)

setDefaultInstance

public void setDefaultInstance(Object instance)

getInstance

public com.google.protobuf.Message getInstance(org.apache.camel.Exchange exchange)
                                        throws Exception
Throws:
Exception

setInstanceClass

public void setInstanceClass(String className)
                      throws Exception
Throws:
Exception

loadDefaultInstance

protected com.google.protobuf.Message loadDefaultInstance(String className,
                                                          org.apache.camel.CamelContext context)
                                                   throws org.apache.camel.CamelException,
                                                          ClassNotFoundException
Throws:
org.apache.camel.CamelException
ClassNotFoundException

marshal

public void marshal(org.apache.camel.Exchange exchange,
                    Object graph,
                    OutputStream outputStream)
             throws Exception
Specified by:
marshal in interface org.apache.camel.spi.DataFormat
Throws:
Exception

unmarshal

public Object unmarshal(org.apache.camel.Exchange exchange,
                        InputStream inputStream)
                 throws Exception
Specified by:
unmarshal in interface org.apache.camel.spi.DataFormat
Throws:
Exception


Apache CAMEL