Package org.apache.camel.processor

Examples of org.apache.camel.processor.MarshalProcessor


    }

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


    }

    @Override
    public Processor createProduceProcessor() {
        ObjectHelper.notNull(producerDataFormat, "producerDataFormat");
        return new MarshalProcessor(producerDataFormat);
    }
View Full Code Here

            this.jsonUnmarshal = new UnmarshalProcessor(jsonDataFormat);
        } else {
            this.jsonUnmarshal = null;
        }
        if (outJsonDataFormat != null) {
            this.jsonMarshal = new MarshalProcessor(outJsonDataFormat);
        } else if (jsonDataFormat != null) {
            this.jsonMarshal = new MarshalProcessor(jsonDataFormat);
        } else {
            this.jsonMarshal = null;
        }

        if (xmlDataFormat != null) {
            this.xmlUnmarshal = new UnmarshalProcessor(xmlDataFormat);
        } else {
            this.xmlUnmarshal = null;
        }
        if (outXmlDataFormat != null) {
            this.xmlMarshal = new MarshalProcessor(outXmlDataFormat);
        } else if (xmlDataFormat != null) {
            this.xmlMarshal = new MarshalProcessor(xmlDataFormat);
        } else {
            this.xmlMarshal = null;
        }

        this.consumes = consumes;
View Full Code Here

    }

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

    }

    @Override
    protected void doStart() throws Exception {
        if (operation.equals("marshal")) {
            marshal = new MarshalProcessor(dataFormat);
            marshal.setCamelContext(getCamelContext());
        } else {
            unmarshal = new UnmarshalProcessor(dataFormat);
            unmarshal.setCamelContext(getCamelContext());
        }
View Full Code Here

    }
   
    @Test
    public void marshal() throws Exception
    {
        final MarshalProcessor marshalProcessor = new MarshalProcessor(dataFormatter);
        final DefaultExchange exchange = new DefaultExchange(camelContext);
        final Customer customer = new Customer();
        customer.setFirstName("John");
        customer.setLastName("Cocktolstol");
        customer.setGender(Gender.Male);
        customer.setAge(35);
        customer.setCountry("USA");
       
        exchange.getIn().setBody(customer, JavaSource.class);
       
        marshalProcessor.process(exchange);
       
        assertXMLEqual(getCustomerXml(CUSTOMER_XML_EXPECTED), exchange.getOut().getBody(String.class));
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.processor.MarshalProcessor

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.