convertBodyTo has been edited by Christian Schneider (Jun 12, 2009).

(View changes)

Content:

Convert the message body to the given class type. To do so camel uses a hierarchy of TypeConverters

Syntax

Java

convertBodyTo(Class type [, String charset])

Spring XML

<convertBodyto type="<String>" [charset="<String>"] >

Parameters

Parameter Type Description
type Class Class type to convert to. For spring dsl use the Fully qualified name
charset String charset name for conversions from byte to String

Examples

convert to Java String

Java

convertBodyTo(String.class)

Spring XML Schema

<< Spring description>>

<convertBodyTo type="java.lang.String"/>

Other types to use:

  • org.w3c.dom.Document: If you read xml files and want the encoding from the xml to be used
  • javax.xml.transform.stream.StreamSource: Streaming source for xml
  • InputStream
  • byte[]

Reply via email to