Package org.apache.camel.spi
Interface DataTypeAware
public interface DataTypeAware
Allows
Message
to store a DataType
which represents the data type of the Message.
Sometimes message content is marshaled into String
, InputStream
or etc, and the data type structure
is not available until it's unmarshaled into Java object. The DataType
stored in a DataTypeAware message
carries that missing data type information even if it's marshaled, and whatever the Java class of the body is. This
type information is used to detect required Transformer
and Validator
.
Data type are automatic turned on if one or more routes has been explicit configured with input and output types.
Otherwise, data type is default off.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionGet the data type of the message.boolean
Whether any data type has been configuredvoid
Set the message body with data type.void
setDataType
(DataType type) Set the data type of the message.
-
Method Details
-
setDataType
Set the data type of the message.- Parameters:
type
- data type
-
getDataType
DataType getDataType()Get the data type of the message.- Returns:
- data type
-
hasDataType
boolean hasDataType()Whether any data type has been configured -
setBody
Set the message body with data type.- Parameters:
body
- message bodytype
- data type
-