public class SmooksDataFormat extends Object implements org.apache.camel.spi.DataFormat, org.apache.camel.CamelContextAware, org.apache.camel.Service
SmooksComponent or SmooksProcessor as they hook
into Camels lifecycle manegment and will close resources correctly.
| Constructor and Description |
|---|
SmooksDataFormat(String smooksConfig) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.camel.CamelContext |
getCamelContext() |
protected Object |
getResult(org.smooks.io.payload.Exports exports,
Result[] results,
org.apache.camel.Exchange exchange) |
void |
marshal(org.apache.camel.Exchange exchange,
Object fromBody,
OutputStream toStream)
Marshals the Object 'fromBody' to an OutputStream 'toStream'
|
void |
setCamelContext(org.apache.camel.CamelContext camelContext) |
void |
start() |
void |
stop() |
Object |
unmarshal(org.apache.camel.Exchange exchange,
InputStream fromStream)
Unmarshals the fromStream to an Object.
|
public void marshal(org.apache.camel.Exchange exchange,
Object fromBody,
OutputStream toStream)
throws Exception
AsyncProcessorSupport.process(Exchange)
and it will take care of setting the Out Message's body to the bytes written to the toStream
OutputStream.marshal in interface org.apache.camel.spi.DataFormatexchange - The Camel Exchange.fromBody - The object to be marshalled into the output stream.toStream - The output stream that will be written to.Exceptionpublic Object unmarshal(org.apache.camel.Exchange exchange, InputStream fromStream)
AsyncProcessorSupport.process(Exchange)
and it will take care of setting the returned Object on the Out Message's body.unmarshal in interface org.apache.camel.spi.DataFormatexchange - The Camel Exchange.fromStream - The InputStream that will be unmarshalled into an Object instance.protected Object getResult(org.smooks.io.payload.Exports exports, Result[] results, org.apache.camel.Exchange exchange)
public 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 void start()
start in interface org.apache.camel.Servicepublic void stop()
stop in interface org.apache.camel.ServiceCopyright © 2021. All rights reserved.