Java 类org.apache.camel.model.dataformat.BindyType 实例源码

项目:Camel    文件:BindyConverterTest.java   
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    RouteBuilder routeBuilder = new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            BindyDataFormat bindy = new BindyDataFormat();
            bindy.setClassType(DataModel.class);
            bindy.setType(BindyType.Fixed);

            from(URI_DIRECT_MARSHALL)
                .marshal(bindy)
                .to(URI_MOCK_MARSHALL_RESULT);
            from(URI_DIRECT_UNMARSHALL)
                .unmarshal().bindy(BindyType.Fixed, DataModel.class)
                .to(URI_MOCK_UNMARSHALL_RESULT);
        }
    };

    return routeBuilder;
}
项目:Camel    文件:BindyFixedLengthHeaderFooterSkipHeaderTest.java   
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    RouteBuilder routeBuilder = new RouteBuilder() {

        @Override
        public void configure() throws Exception {
            BindyDataFormat bindy = new BindyDataFormat();
            bindy.setClassType(Order.class);
            bindy.setLocale("en");
            bindy.setType(BindyType.Fixed);

            from(URI_DIRECT_MARSHALL)
                .marshal(bindy)
                .to(URI_MOCK_MARSHALL_RESULT);

            from(URI_DIRECT_UNMARSHALL)
                .unmarshal().bindy(BindyType.Fixed, Order.class)
                .to(URI_MOCK_UNMARSHALL_RESULT);
        }
    };

    return routeBuilder;
}
项目:Camel    文件:BindySimpleIgnoreTrailingCharsTest.java   
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    RouteBuilder routeBuilder = new RouteBuilder() {

        @Override
        public void configure() throws Exception {
            BindyDataFormat bindy = new BindyDataFormat();
            bindy.setClassType(BindySimpleIgnoreTrailingCharsTest.Order.class);
            bindy.setLocale("en");
            bindy.setType(BindyType.Fixed);

            from(URI_DIRECT_MARSHALL)
                .marshal(bindy)
                .to(URI_MOCK_MARSHALL_RESULT);

            from(URI_DIRECT_UNMARSHALL)
                .unmarshal().bindy(BindyType.Fixed, BindySimpleIgnoreTrailingCharsTest.Order.class)
                .to(URI_MOCK_UNMARSHALL_RESULT);
        }
    };

    return routeBuilder;
}
项目:Camel    文件:BindySimpleFixedLengthWithLinkTest.java   
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    RouteBuilder routeBuilder = new RouteBuilder() {

        @Override
        public void configure() throws Exception {
            BindyDataFormat bindy = new BindyDataFormat();
            bindy.setClassType(Order.class);
            bindy.setLocale("en");
            bindy.setType(BindyType.Fixed);

            from(URI_DIRECT_UNMARSHALL)
                    .unmarshal(bindy)
                    .to(URI_MOCK_UNMARSHALL_RESULT);

            from(URI_DIRECT_MARSHALL)
                    .marshal(bindy)
                    .to(URI_MOCK_MARSHALL_RESULT);
        }
    };

    return routeBuilder;
}
项目:Camel    文件:BindySimpleFixedLengthMarshallTest.java   
public void configure() {

            Tracer tracer = new Tracer();
            tracer.setLogLevel(LoggingLevel.ERROR);
            tracer.setLogName("org.apache.camel.bindy");

            getContext().addInterceptStrategy(tracer);

            // default should errors go to mock:error
            errorHandler(deadLetterChannel(URI_MOCK_ERROR).redeliveryDelay(0));

            onException(Exception.class).maximumRedeliveries(0).handled(true);

            BindyDataFormat bindy = new BindyDataFormat();
            bindy.setLocale("en");
            bindy.setClassType(Order.class);
            bindy.setType(BindyType.Fixed);

            from(URI_DIRECT_START)
                    .marshal(bindy)
                    .to(URI_MOCK_RESULT);
        }
项目:Camel    文件:BindySimpleFixedLengthObjectMarshallTest.java   
@Bean
@Override
public RouteBuilder route() {
    return new RouteBuilder() {
        public void configure() {
            Tracer tracer = new Tracer();
            tracer.setLogLevel(LoggingLevel.ERROR);
            tracer.setLogName("org.apache.camel.bindy");
            getContext().addInterceptStrategy(tracer);

            // default should errors go to mock:error
            errorHandler(deadLetterChannel(URI_MOCK_ERROR).redeliveryDelay(0));

            onException(Exception.class).maximumRedeliveries(0).handled(true);

            BindyDataFormat bindy = new BindyDataFormat();
            bindy.setLocale("en");
            bindy.setClassType(Order.class);
            bindy.setType(BindyType.Fixed);

            from(URI_DIRECT_START)
                    .marshal(bindy)
                    .to(URI_MOCK_RESULT);
        }
    };
}
项目:Camel    文件:BindySimpleFixedLengthHeaderFooterTest.java   
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    RouteBuilder routeBuilder = new RouteBuilder() {

        @Override
        public void configure() throws Exception {
            BindyDataFormat bindy = new BindyDataFormat();
            bindy.setClassType(Order.class);
            bindy.setLocale("en");
            bindy.setType(BindyType.Fixed);

            from(URI_DIRECT_MARSHALL)
                .marshal(bindy)
                .to(URI_MOCK_MARSHALL_RESULT);

            from(URI_DIRECT_UNMARSHALL)
                .unmarshal().bindy(BindyType.Fixed, Order.class)
                .to(URI_MOCK_UNMARSHALL_RESULT);
        }
    };

    return routeBuilder;
}
项目:Camel    文件:BindySimpleFixedLengthOrdinalPosTest.java   
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    RouteBuilder routeBuilder = new RouteBuilder() {

        @Override
        public void configure() throws Exception {
            BindyDataFormat bindy = new BindyDataFormat();
            bindy.setClassType(BindySimpleFixedLengthOrdinalPosTest.Order.class);
            bindy.setLocale("en");
            bindy.setType(BindyType.Fixed);

            from(URI_DIRECT_MARSHALL)
                .marshal(bindy)
                .to(URI_MOCK_MARSHALL_RESULT);

            from(URI_DIRECT_UNMARSHALL)
                .unmarshal().bindy(BindyType.Fixed, BindySimpleFixedLengthOrdinalPosTest.Order.class)
                .to(URI_MOCK_UNMARSHALL_RESULT);
        }
    };

    return routeBuilder;
}
项目:Camel    文件:BindySimpleSkipFieldsTest.java   
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    RouteBuilder routeBuilder = new RouteBuilder() {

        @Override
        public void configure() throws Exception {
            BindyDataFormat bindy = new BindyDataFormat();
            bindy.setClassType(BindySimpleSkipFieldsTest.Order.class);
            bindy.setLocale("en");
            bindy.setType(BindyType.Fixed);

            from(URI_DIRECT_MARSHALL)
                .marshal(bindy)
                .to(URI_MOCK_MARSHALL_RESULT);

            from(URI_DIRECT_UNMARSHALL)
                .unmarshal().bindy(BindyType.Fixed, BindySimpleSkipFieldsTest.Order.class)
                .to(URI_MOCK_UNMARSHALL_RESULT);
        }
    };

    return routeBuilder;
}
项目:Camel    文件:BindyFixedLengthDelimitedFieldTest.java   
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    RouteBuilder routeBuilder = new RouteBuilder() {

        @Override
        public void configure() throws Exception {
            BindyDataFormat bindy = new BindyDataFormat();
            bindy.setClassType(BindyFixedLengthDelimitedFieldTest.Order.class);
            bindy.setLocale("en");
            bindy.setType(BindyType.Fixed);

            from(URI_DIRECT_MARSHALL)
                .marshal(bindy)
                .to(URI_MOCK_MARSHALL_RESULT);

            from(URI_DIRECT_UNMARSHALL)
                .unmarshal().bindy(BindyType.Fixed, BindyFixedLengthDelimitedFieldTest.Order.class)
                .to(URI_MOCK_UNMARSHALL_RESULT);
        }
    };

    return routeBuilder;
}
项目:Camel    文件:BindyFixedLengthDynamicFieldTest.java   
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    RouteBuilder routeBuilder = new RouteBuilder() {

        @Override
        public void configure() throws Exception {
            BindyDataFormat bindy = new BindyDataFormat();
            bindy.setLocale("en");
            bindy.setClassType(BindyFixedLengthDynamicFieldTest.Order.class);
            bindy.setType(BindyType.Fixed);

            from(URI_DIRECT_MARSHALL)
                .marshal(bindy)
                .to(URI_MOCK_MARSHALL_RESULT);

            from(URI_DIRECT_UNMARSHALL)
                .unmarshal().bindy(BindyType.Fixed, BindyFixedLengthDynamicFieldTest.Order.class)
                .to(URI_MOCK_UNMARSHALL_RESULT);
        }
    };

    return routeBuilder;
}
项目:Camel    文件:BindyBigDecimalRoundingUnmarshallTest.java   
@Override
protected RouteBuilder createRouteBuilder() {

    return new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            BindyDataFormat bindy = new BindyDataFormat();
            bindy.setType(BindyType.Csv);
            bindy.setClassType(NumberModel.class);
            bindy.setLocale("en");

            from(URI_DIRECT_START)
                .unmarshal(bindy)
                .to(URI_MOCK_RESULT);
        }

    };
}
项目:Camel    文件:BindyBigDecimalGroupingUnmarshallTest.java   
@Override
protected RouteBuilder createRouteBuilder() {

    return new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            BindyDataFormat bindy = new BindyDataFormat();
            bindy.setType(BindyType.Csv);
            bindy.setClassType(NumberModel.class);
            bindy.setLocale("en");

            from(URI_DIRECT_START)
                .unmarshal(bindy)
                .to(URI_MOCK_RESULT);
        }

    };
}
项目:Camel    文件:BindyCsvClassTypeTest.java   
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    return new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            BindyDataFormat bindy = new BindyDataFormat();
            bindy.setClassType(Order.class);
            bindy.setLocale("en");
            bindy.setType(BindyType.Csv);

            from("direct:in")
                .marshal(bindy)
                .to("mock:in");

            from("direct:out")
                .unmarshal().bindy(BindyType.Csv, Order.class)
                .to("mock:out");
        }
    };
}
项目:Camel    文件:BindyCsvClassTypeAsStringTest.java   
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    return new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            BindyDataFormat bindy = new BindyDataFormat();
            bindy.setClassType(org.apache.camel.dataformat.bindy.model.simple.oneclass.Order.class);
            bindy.setLocale("en");
            bindy.setType(BindyType.Csv);

            from("direct:in")
                .marshal(bindy)
                .to("mock:in");

            from("direct:out")
                .unmarshal().bindy(BindyType.Csv, org.apache.camel.dataformat.bindy.model.simple.oneclass.Order.class)
                .to("mock:out");

        }
    };
}
项目:Camel    文件:BindyCarQuoteAndCommaDelimiterTest.java   
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    return new RouteBuilder() {
        @Override
        public void configure() throws Exception {

            Class<?> type = org.apache.camel.dataformat.bindy.model.car.Car.class;
            BindyCsvDataFormat dataFormat = new BindyCsvDataFormat();
            dataFormat.setClassType(type);
            dataFormat.setLocale("en");

            from("direct:out")
                .unmarshal().bindy(BindyType.Csv, type)
                .to("mock:out");
            from("direct:in")
                .marshal(dataFormat)
                .to("mock:in");
        }
    };
}
项目:market-data-feed    文件:YahooRouteBuilder.java   
@Override
public void configure() {

    errorHandler(deadLetterChannel(deadQueue));

    from(inQueue).routeId("yahoo")
            .process(jsonConsumerProcessor)
            .convertBodyTo(String.class)
            .setHeader(Exchange.HTTP_METHOD, constant("GET"))
            .setHeader(Exchange.HTTP_URI, body(String.class))
            .to("http://dummy")
            .to("direct:splitter");

    from("direct:splitter").routeId("splitter")
            .unmarshal().bindy(BindyType.Csv, YahooCSV.class)
            .split(body()).streaming().executorService(executorService)
            .to("direct:reply");

    from("direct:reply").routeId("reply")
            .convertBodyTo(InstrumentPriceCommandMessage.class)
            .setHeader(JmsConstants.JMS_DESTINATION, header(ASYNC_REPLY_TO))
            .process(jsonProducerProcessor)
            .to("jms:queue:asyncreplydummy");

    getContext().setTracing(yahooTrace);
}
项目:Camel    文件:BindyNumberTest.java   
public void configure() {
    BindyDataFormat bindy = new BindyDataFormat();
    bindy.setClassType(DataModel.class);
    bindy.setLocale("en");
    bindy.setType(BindyType.Fixed);

    from(URI_DIRECT_MARSHALL)
        .marshal(bindy)
        .to(URI_MOCK_MARSHALL_RESULT);
    from(URI_DIRECT_UNMARSHALL)
        .unmarshal().bindy(BindyType.Fixed, DataModel.class)
        .to(URI_MOCK_UNMARSHALL_RESULT);
}
项目:Camel    文件:BindyImpliedTest.java   
public void configure() {
    BindyDataFormat bindy = new BindyDataFormat();
    bindy.setClassType(Record.class);
    bindy.setLocale("en");
    bindy.setType(BindyType.Fixed);

    from(URI_DIRECT_MARSHALL)
        .marshal(bindy)
        .to(URI_MOCK_MARSHALL_RESULT);
    from(URI_DIRECT_UNMARSHALL)
        .unmarshal().bindy(BindyType.Fixed, Record.class)
        .to(URI_MOCK_UNMARSHALL_RESULT);
}
项目:Camel    文件:BindyMarshalWithQuoteTest.java   
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    return new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            from("direct:start")
                .marshal().bindy(BindyType.Csv, org.apache.camel.dataformat.bindy.csv2.WeatherModel.class)
                .to("mock:result");
        }
    };
}
项目:Camel    文件:BindyMarshalUnmarshalssueTest.java   
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    return new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            from("direct:start")
                .marshal().bindy(BindyType.Csv, org.apache.camel.dataformat.bindy.csv2.WeatherModel.class)
                .to("direct:middle");

            from("direct:middle")
                .unmarshal(new BindyCsvDataFormat(org.apache.camel.dataformat.bindy.csv2.WeatherModel.class))
                .to("mock:result");
        }
    };
}
项目:Camel    文件:BindyUnmarshalCommaIssueTest.java   
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    return new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            from("direct:start")
                .unmarshal().bindy(BindyType.Csv, org.apache.camel.dataformat.bindy.csv2.WeatherModel.class)
                .to("mock:result");
        }
    };
}
项目:Camel    文件:BindySimpleCsvMarshallDslTest.java   
public void configure() {
    BindyDataFormat bindy = new BindyDataFormat();
    bindy.setLocale("en");
    bindy.setClassType(org.apache.camel.dataformat.bindy.model.simple.oneclass.Order.class);
    bindy.setType(BindyType.Csv);

    from("direct:start").
        marshal(bindy)
        .to("mock:result");
}
项目:Camel    文件:BindyCsvFieldEndingWithSeparatorIssueTest.java   
private RouteBuilder createRoute() {
    return new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            from("direct:fromCsv").unmarshal().bindy(BindyType.Csv, MyCsvRecord.class)
                .setProperty("addressLine1", simple("${in.body.addressLine1}"))
                .setProperty("addressLine2", simple("${in.body.addressLine2}")).log("${in.body}")
                .to("mock:result");
        }
    };
}
项目:Camel    文件:BindyPipeDelimiterTest.java   
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    return new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            from("direct:unmarshal")
                .unmarshal().bindy(BindyType.Csv, org.apache.camel.dataformat.bindy.model.simple.pipeline.MyData.class)
                .to("mock:result");

            from("direct:marshal")
                .marshal().bindy(BindyType.Csv, org.apache.camel.dataformat.bindy.model.simple.pipeline.MyData.class)
                .to("mock:result");
        }
    };
}
项目:camelinaction2    文件:PurchaseOrderUnmarshalBindyTest.java   
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");
        }
    };
}
项目:camelinaction2    文件:PurchaseOrderBindyTest.java   
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");
        }
    };
}
项目:camelinaction    文件:PurchaseOrderUnmarshalBindyTest.java   
public RouteBuilder createRoute() {
    return new RouteBuilder() {
        public void configure() throws Exception {
            from("direct:toObject")
                    .unmarshal().bindy(BindyType.Csv, "camelinaction.bindy")
                    .to("mock:result");
        }
    };
}
项目:camelinaction    文件:PurchaseOrderBindyTest.java   
public RouteBuilder createRoute() {
    return new RouteBuilder() {
        public void configure() throws Exception {
            from("direct:toCsv")
                    .marshal().bindy(BindyType.Csv, "camelinaction.bindy")
                    .to("mock:result");
        }
    };
}
项目:t4f-data    文件:PurchaseOrderUnmarshalBindyTest.java   
public RouteBuilder createRoute() {
    return new RouteBuilder() {
        public void configure() throws Exception {
            from("direct:toObject")
                    .unmarshal().bindy(BindyType.Csv, "camelinaction.bindy")
                    .to("mock:result");
        }
    };
}
项目:t4f-data    文件:PurchaseOrderBindyTest.java   
public RouteBuilder createRoute() {
    return new RouteBuilder() {
        public void configure() throws Exception {
            from("direct:toCsv")
                    .marshal().bindy(BindyType.Csv, "camelinaction.bindy")
                    .to("mock:result");
        }
    };
}
项目:Camel    文件:BindyFixedLengthDataFormatConfiguration.java   
public BindyType getType() {
    return type;
}
项目:Camel    文件:BindyFixedLengthDataFormatConfiguration.java   
public void setType(BindyType type) {
    this.type = type;
}
项目:Camel    文件:BindyKeyValuePairDataFormatConfiguration.java   
public BindyType getType() {
    return type;
}
项目:Camel    文件:BindyKeyValuePairDataFormatConfiguration.java   
public void setType(BindyType type) {
    this.type = type;
}
项目:Camel    文件:BindyCsvDataFormatConfiguration.java   
public BindyType getType() {
    return type;
}
项目:Camel    文件:BindyCsvDataFormatConfiguration.java   
public void setType(BindyType type) {
    this.type = type;
}
项目:Camel    文件:BindySimpleKeyValuePairMarshallDslTest.java   
public void configure() {
    from("direct:start").marshal()
        .bindy(BindyType.KeyValue, org.apache.camel.dataformat.bindy.model.fix.simple.Order.class)
        .to("mock:result");
}
项目:Camel    文件:BindySimpleKeyValuePairUnmarshallDslTest.java   
public void configure() {
    from(URI_FILE_FIX).unmarshal()
        .bindy(BindyType.KeyValue, Order.class)
        .to(URI_MOCK_RESULT);
}