You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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])

Parameter

Type

Description

type

Class

Class type to convert to

charset

String

charset name for conversions from byte to String

Spring XML

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

Parameter

Type

Description

type

String

Fully qualified name of a Java Class to convert to

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"/>
  • No labels