Package org.apache.camel.spi
Class DataType
java.lang.Object
org.apache.camel.spi.DataType
Represents the data type URN which is used for message data type contract.
Java class doesn't always explain the data type completely, for example XML and JSON data format is sometimes
serialized as a
String
, InputStream
or etc. The DataTypeAware
message stores the DataType as
a part of the message to carry those data type information even if it's marshaled, so that it could be leveraged to
detect required Transformer
and Validator
. DataType URN consists of two parts, 'scheme' and 'name'.
Its string representation is 'scheme:name' connected with colon. For example 'java:com.example.Order', 'xml:ABCOrder'
or 'json:XYZOrder'. These type name other than java class name allows the message to carry the name of the message
data structure even if it's marshaled.
The scheme can also be used to associate the same DataType with different Camel components. For example
`http:cloud-events` and `aws-s3:cloud-events` where the scheme relates to the respective component's scheme. This
information could be leveraged to detect required Transformer
and Validator
implementations provided
as part of these components.- See Also:
-
Field Details
-
DEFAULT_SCHEME
- See Also:
-
JAVA_TYPE_SCHEME
- See Also:
-
ANY_TYPE_URN
- See Also:
-
ANY
-
-
Constructor Details
-
DataType
-
DataType
-
-
Method Details