Package org.apache.camel.spi

Examples of org.apache.camel.spi.DataFormat


        super("barcode");
    }
   
    @Override
    protected DataFormat createDataFormat(RouteContext routeContext) {
        DataFormat barcodeFormat = super.createDataFormat(routeContext);

        return barcodeFormat;
    }
View Full Code Here


    public void setDataFormatResolver(DataFormatResolver dataFormatResolver) {
        this.dataFormatResolver = dataFormatResolver;
    }

    public DataFormat resolveDataFormat(String name) {
        DataFormat answer = dataFormatResolver.resolveDataFormat(name, this);

        // inject CamelContext if aware
        if (answer != null && answer instanceof CamelContextAware) {
            ((CamelContextAware) answer).setCamelContext(this);
        }
View Full Code Here

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() throws Exception {
                // START SNIPPET: e1
                DataFormat hl7 = new HL7DataFormat();
                // we setup or HL7 listener on port 8888 (using the hl7codec) and in sync mode so we can return a response
                from("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec")
                    // we use the HL7 data format to unmarshal from HL7 stream to the HAPI Message model
                    // this ensures that the camel message has been enriched with hl7 specific headers to
                    // make the routing much easier (see below)
View Full Code Here

        return new RouteBuilder() {
            @Override
            public void configure() {

                // QR-Code default
                DataFormat code1 = new BarcodeDataFormat();

                from("direct:code1")
                        .marshal(code1)
                        .to(FILE_ENDPOINT);

                // QR-Code with modified size
                DataFormat code2 = new BarcodeDataFormat(200, 200);

                from("direct:code2")
                        .marshal(code2)
                        .to(FILE_ENDPOINT);

                // QR-Code with JPEG type
                DataFormat code3 = new BarcodeDataFormat(BarcodeImageType.JPG);

                from("direct:code3")
                        .marshal(code3)
                        .to(FILE_ENDPOINT);

                // PDF-417 code with modified size and image type
                DataFormat code4 = new BarcodeDataFormat(200, 200, BarcodeImageType.JPG, BarcodeFormat.PDF_417);
               
                from("direct:code4")
                        .marshal(code4)
                        .to(FILE_ENDPOINT);

                // AZTEC with modified size and PNG type
                DataFormat code5 = new BarcodeDataFormat(200, 200, BarcodeImageType.PNG, BarcodeFormat.AZTEC);

                from("direct:code5")
                        .marshal(code5)
                        .to(FILE_ENDPOINT);
View Full Code Here

    public void setDataFormatResolver(DataFormatResolver dataFormatResolver) {
        this.dataFormatResolver = dataFormatResolver;
    }

    public DataFormat resolveDataFormat(String name) {
        DataFormat answer = dataFormatResolver.resolveDataFormat(name, this);

        // inject CamelContext if aware
        if (answer != null && answer instanceof CamelContextAware) {
            ((CamelContextAware) answer).setCamelContext(this);
        }
View Full Code Here

        this.lazyLoad = lazyLoad;
    }

    @Override
    protected DataFormat createDataFormat(RouteContext routeContext) {
        DataFormat csvFormat = super.createDataFormat(routeContext);

        if (ObjectHelper.isNotEmpty(configRef)) {
            Object config = CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), configRef);
            setProperty(routeContext.getCamelContext(), csvFormat, "config", config);
        }
View Full Code Here

    public void setDataFormatResolver(DataFormatResolver dataFormatResolver) {
        this.dataFormatResolver = dataFormatResolver;
    }

    public DataFormat resolveDataFormat(String name) {
        DataFormat answer = dataFormatResolver.resolveDataFormat(name, this);

        // inject CamelContext if aware
        if (answer != null && answer instanceof CamelContextAware) {
            ((CamelContextAware) answer).setCamelContext(this);
        }
View Full Code Here

    public void setDataFormatResolver(DataFormatResolver dataFormatResolver) {
        this.dataFormatResolver = dataFormatResolver;
    }

    public DataFormat resolveDataFormat(String name) {
        DataFormat answer = dataFormatResolver.resolveDataFormat(name, this);

        // inject CamelContext if aware
        if (answer != null && answer instanceof CamelContextAware) {
            ((CamelContextAware) answer).setCamelContext(this);
        }
View Full Code Here

        this.dataFormatType = dataFormatType;
    }

    @Override
    public Processor createProcessor(RouteContext routeContext) {
        DataFormat dataFormat = DataFormatType.getDataFormat(routeContext, getDataFormatType(), ref);
        return new UnmarshalProcessor(dataFormat);
    }
View Full Code Here

        this.dataFormatType = dataFormatType;
    }

    @Override
    public Processor createProcessor(RouteContext routeContext) {
        DataFormat dataFormat = DataFormatType.getDataFormat(routeContext, getDataFormatType(), ref);
        return new MarshalProcessor(dataFormat);
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.spi.DataFormat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.