public class TransformerBuilder extends Object
Transformer and register into CamelContext.
It requires 'scheme' or a pair of 'from' and 'to' to be specified by scheme(), from() and to() method.
And then you can choose a type of transformer by withUri(), withDataFormat(), withJava() or withBean() method.| Constructor and Description |
|---|
TransformerBuilder() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(CamelContext camelContext)
Configure a Transformer according to the configurations built on this builder
and register it into given
CamelContext. |
TransformerBuilder |
fromType(Class<?> from)
Set the 'from' data type using Java class.
|
TransformerBuilder |
fromType(String from)
Set the 'from' data type name.
|
TransformerBuilder |
scheme(String scheme)
Set the scheme name supported by the transformer.
|
TransformerBuilder |
toType(Class<?> to)
Set the 'to' data type using Java class.
|
TransformerBuilder |
toType(String to)
Set the 'to' data type name.
|
TransformerBuilder |
withBean(String ref)
Set the Java Bean name to be used for custom
Transformer. |
TransformerBuilder |
withDataFormat(DataFormatDefinition dataFormatDefinition)
Set the
DataFormatDefinition to be used for the DataFormat Transformer. |
TransformerBuilder |
withJava(Class<? extends Transformer> clazz)
Set the Java
Class represents a custom Transformer implementation class. |
TransformerBuilder |
withUri(String uri)
Set the URI to be used for the endpoint
Transformer. |
public TransformerBuilder()
public TransformerBuilder scheme(String scheme)
scheme - scheme namepublic TransformerBuilder fromType(String from)
from - 'from' data type namepublic TransformerBuilder fromType(Class<?> from)
from - 'from' Java classpublic TransformerBuilder toType(String to)
to - 'to' data typepublic TransformerBuilder toType(Class<?> to)
to - 'to' Java classpublic TransformerBuilder withUri(String uri)
Transformer.uri - endpoint URIpublic TransformerBuilder withDataFormat(DataFormatDefinition dataFormatDefinition)
DataFormatDefinition to be used for the DataFormat Transformer.public TransformerBuilder withJava(Class<? extends Transformer> clazz)
Class represents a custom Transformer implementation class.public TransformerBuilder withBean(String ref)
Transformer.public void configure(CamelContext camelContext)
CamelContext.camelContext - CamelContextApache Camel