org.apache.camel.model.dataformat.BindyType Java Examples

The following examples show how to use org.apache.camel.model.dataformat.BindyType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BindyTestRoute.java    From camel-quarkus with Apache License 2.0 6 votes vote down vote up
@Override
public void configure() {
    BindyDataFormat bindyCsvDataFormat = new BindyDataFormat();
    bindyCsvDataFormat.setClassType(CsvOrder.class);
    bindyCsvDataFormat.setType(BindyType.Csv.name());
    from("direct:jsonToCsv").marshal(bindyCsvDataFormat);
    from("direct:csvToJson").unmarshal(bindyCsvDataFormat);

    BindyDataFormat bindyFixedLengthDataFormat = new BindyDataFormat();
    bindyFixedLengthDataFormat.setClassType(FixedLengthOrder.class);
    bindyFixedLengthDataFormat.setType(BindyType.Fixed.name());
    from("direct:jsonToFixedLength").marshal(bindyFixedLengthDataFormat);
    from("direct:fixedLengthToJson").unmarshal(bindyFixedLengthDataFormat);

    BindyKeyValuePairDataFormat bindyMessageDataFormat = new BindyKeyValuePairDataFormat(MessageOrder.class);
    from("direct:jsonToMessage").marshal(bindyMessageDataFormat);
    from("direct:messageToJson").unmarshal(bindyMessageDataFormat);
}
 
Example #2
Source File: PurchaseOrderUnmarshalBindyTest.java    From camelinaction2 with Apache License 2.0 5 votes vote down vote up
public RouteBuilder createRoute() {
    return new RouteBuilder() {
        public void configure() throws Exception {
            from("direct:toObject")
                    .unmarshal().bindy(BindyType.Csv, camelinaction.bindy.PurchaseOrder.class)
                    .to("mock:result");
        }
    };
}
 
Example #3
Source File: PurchaseOrderBindyTest.java    From camelinaction2 with Apache License 2.0 5 votes vote down vote up
public RouteBuilder createRoute() {
    return new RouteBuilder() {
        public void configure() throws Exception {
            from("direct:toCsv")
                    .marshal().bindy(BindyType.Csv, camelinaction.bindy.PurchaseOrder.class)
                    .to("mock:result");
        }
    };
}
 
Example #4
Source File: PurchaseOrderUnmarshalBindyTest.java    From camelinaction with Apache License 2.0 5 votes vote down vote up
public RouteBuilder createRoute() {
    return new RouteBuilder() {
        public void configure() throws Exception {
            from("direct:toObject")
                    .unmarshal().bindy(BindyType.Csv, "camelinaction.bindy")
                    .to("mock:result");
        }
    };
}
 
Example #5
Source File: PurchaseOrderBindyTest.java    From camelinaction with Apache License 2.0 5 votes vote down vote up
public RouteBuilder createRoute() {
    return new RouteBuilder() {
        public void configure() throws Exception {
            from("direct:toCsv")
                    .marshal().bindy(BindyType.Csv, "camelinaction.bindy")
                    .to("mock:result");
        }
    };
}