org.apache.camel.dataformat.bindy.fixed
Class BindyFixedLengthDataFormat

java.lang.Object
  extended by org.apache.camel.dataformat.bindy.fixed.BindyFixedLengthDataFormat
All Implemented Interfaces:
DataFormat

public class BindyFixedLengthDataFormat
extends Object
implements DataFormat

A data format ( DataFormat) using Bindy to marshal to and from Fixed Length


Constructor Summary
BindyFixedLengthDataFormat()
           
BindyFixedLengthDataFormat(String... packages)
           
 
Method Summary
 BindyFixedLengthFactory getFactory(PackageScanClassResolver resolver)
          Method used to create the singleton of the BindyCsvFactory
 String[] getPackages()
           
 void marshal(Exchange exchange, Object body, OutputStream outputStream)
          Marshals the object to the given Stream.
 void setModelFactory(BindyFixedLengthFactory modelFactory)
           
 void setPackages(String[] packages)
           
 Object unmarshal(Exchange exchange, InputStream inputStream)
          Unmarshals the given stream into an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BindyFixedLengthDataFormat

public BindyFixedLengthDataFormat()

BindyFixedLengthDataFormat

public BindyFixedLengthDataFormat(String... packages)
Method Detail

marshal

public void marshal(Exchange exchange,
                    Object body,
                    OutputStream outputStream)
             throws Exception
Description copied from interface: DataFormat
Marshals the object to the given Stream.

Specified by:
marshal in interface DataFormat
Parameters:
exchange - the current exchange
body - the object to be marshalled
outputStream - the output stream to write the marshalled result to
Throws:
Exception - can be thrown

unmarshal

public Object unmarshal(Exchange exchange,
                        InputStream inputStream)
                 throws Exception
Description copied from interface: DataFormat
Unmarshals the given stream into an object.

Notice: The result is set as body on the exchange OUT message. It is possible to mutate the OUT message provided in the given exchange parameter. For instance adding headers to the OUT message will be preserved.

Specified by:
unmarshal in interface DataFormat
Parameters:
exchange - the current exchange
inputStream - the input stream with the object to be unmarshalled
Returns:
the unmarshalled object
Throws:
Exception - can be thrown

getFactory

public BindyFixedLengthFactory getFactory(PackageScanClassResolver resolver)
                                   throws Exception
Method used to create the singleton of the BindyCsvFactory

Throws:
Exception

setModelFactory

public void setModelFactory(BindyFixedLengthFactory modelFactory)

getPackages

public String[] getPackages()

setPackages

public void setPackages(String[] packages)


Copyright © 2007-2010 IONA Open Source Community. All Rights Reserved.