use of org.apache.camel.dataformat.bindy.fixed.BindyFixedLengthDataFormat in project camel by apache.
the class BindyFixedLengthDataFormatAutoConfiguration method configureBindyFixedLengthDataFormatFactory.
@Bean(name = "bindy-fixed-dataformat-factory")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(BindyFixedLengthDataFormat.class)
public DataFormatFactory configureBindyFixedLengthDataFormatFactory(final CamelContext camelContext, final BindyFixedLengthDataFormatConfiguration configuration) {
return new DataFormatFactory() {
public DataFormat newInstance() {
BindyFixedLengthDataFormat dataformat = new BindyFixedLengthDataFormat();
if (CamelContextAware.class.isAssignableFrom(BindyFixedLengthDataFormat.class)) {
CamelContextAware contextAware = CamelContextAware.class.cast(dataformat);
if (contextAware != null) {
contextAware.setCamelContext(camelContext);
}
}
try {
Map<String, Object> parameters = new HashMap<>();
IntrospectionSupport.getProperties(configuration, parameters, null, false);
IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters);
} catch (Exception e) {
throw new RuntimeCamelException(e);
}
return dataformat;
}
};
}
use of org.apache.camel.dataformat.bindy.fixed.BindyFixedLengthDataFormat in project camel by apache.
the class BindySimpleFixedLengthMarshallWithClipAndTrimTest method createRouteBuilder.
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
BindyFixedLengthDataFormat bindy = new BindyFixedLengthDataFormat(Order.class);
bindy.setLocale("en");
from("direct:start").marshal(bindy).to("mock:result");
}
};
}
use of org.apache.camel.dataformat.bindy.fixed.BindyFixedLengthDataFormat in project camel by apache.
the class BindySimpleFixedLengthMarshallWithClipTest method createRouteBuilder.
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
BindyFixedLengthDataFormat bindy = new BindyFixedLengthDataFormat(Order.class);
bindy.setLocale("en");
from("direct:start").marshal(bindy).to("mock:result");
}
};
}
use of org.apache.camel.dataformat.bindy.fixed.BindyFixedLengthDataFormat in project camel by apache.
the class BindySimpleFixedLengthMarshallWithNoClipTest method createRouteBuilder.
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
BindyFixedLengthDataFormat bindy = new BindyFixedLengthDataFormat(Order.class);
from("direct:start").marshal(bindy).to("mock:result");
}
};
}
Aggregations