Package org.milyn.javabean

Examples of org.milyn.javabean.Bean.bindTo()


            if(bindingType == FixedLengthBindingType.LIST) {
                Bean listBean = new Bean(ArrayList.class, bindBeanId, "$document");

                bean = listBean.newBean(bindBeanClass, recordElementName);
                listBean.bindTo(bean);
                addFieldBindings(bean);

                listBean.addVisitors(visitorMap);
            } else if(bindingType == FixedLengthBindingType.MAP) {
                if(bindMapKeyField == null) {
View Full Code Here


                // Smooks JavaBean programmatic configuration
                final String beanId = "coordinate";
                final String selector = "coords/coord";
                final Bean beanConfig = new Bean(Coordinate.class, beanId, selector);
                beanConfig.bindTo("x", "coords/coord/@x").bindTo("y", "coords/coord/@y");
                smooksProcessor.addVisitor(beanConfig);

                // Smooks Camel BeanRouter programmatic configuration
                final BeanRouter camelBeanRouter = new BeanRouter(context);
                camelBeanRouter.setBeanId(beanId).setToEndpoint(toEndpoint)
View Full Code Here

            if(bindingType == CSVBindingType.LIST) {
                Bean listBean = new Bean(ArrayList.class, bindBeanId, "$document");

                bean = listBean.newBean(bindBeanClass, recordElementName);
                listBean.bindTo(bean);
                addFieldBindings(bean);

                listBean.addVisitors(visitorMap);
            } else if(bindingType == CSVBindingType.MAP) {
                if(bindMapKeyField == null) {
View Full Code Here

    public void test_01_fluent() {
        Smooks smooks = new Smooks();
        Bean orderBean = new Bean(Order.class, "order", "/order");

        orderBean.bindTo("header",
            orderBean.newBean(Header.class, "/order")
                .bindTo("order", orderBean)
                .bindTo("customerNumber", "header/customer/@number")
                .bindTo("customerName", "header/customer")
                .bindTo("privatePerson", "header/privatePerson")
View Full Code Here

        return new Order();
      }

        });

        orderBean.bindTo("header",
            orderBean.newBean(Header.class, "/order")
                .bindTo("order", orderBean)
                .bindTo("customerNumber", "header/customer/@number")
                .bindTo("customerName", "header/customer")
                .bindTo("privatePerson", "header/privatePerson")
View Full Code Here

        smooks.addVisitor(orderBean);

        try {
            // invalid attempt to bindTo after it has been added to the Smooks instance...
            orderBean.bindTo("header",
                orderBean.newBean(Header.class, "/order")
                    .bindTo("privatePerson", "header/privatePerson"));

            fail("Expected IllegalStateException");
        } catch(IllegalStateException e) {
View Full Code Here

    namespaces.setProperty("e", "http://www.example.net");
    namespaces.setProperty("f", "http://www.blah");
    smooks.setNamespaces(namespaces);
   
    Bean beanConfig = new Bean(HashMap.class, "theBean");
    beanConfig.bindTo("attr1", "test1/@e:attr1");
    beanConfig.bindTo("attr2", "test1/@f:attr2");   
    smooks.addVisitor(beanConfig);
   
    test(smooks);
    }
View Full Code Here

    namespaces.setProperty("f", "http://www.blah");
    smooks.setNamespaces(namespaces);
   
    Bean beanConfig = new Bean(HashMap.class, "theBean");
    beanConfig.bindTo("attr1", "test1/@e:attr1");
    beanConfig.bindTo("attr2", "test1/@f:attr2");   
    smooks.addVisitor(beanConfig);
   
    test(smooks);
    }
   
View Full Code Here

            if (bindingType == BindingType.LIST) {
                Bean listBean = new Bean(ArrayList.class, bindBeanId,
                        SmooksResourceConfiguration.DOCUMENT_FRAGMENT_SELECTOR);

                bean = listBean.newBean(bindBeanClass, recordElementName);
                listBean.bindTo(bean);
                addFieldBindings(bean);

                listBean.addVisitors(visitorMap);
            } else if (bindingType == BindingType.MAP) {
                if (bindMapKeyField == null) {
View Full Code Here

    public void test_02_Map_fluid() {
        Smooks smooks = new Smooks();

        Bean orderBean = new Bean(HashMap.class, "order", "/order");

        orderBean.bindTo("header",
                orderBean.newBean(HashMap.class, "/order")
                    .bindTo("customerNumber", "header/customer/@number", new IntegerDecoder())
                    .bindTo("customerName", "header/customer")
                    .bindTo("privatePerson", "header/privatePerson")
                ).bindTo("orderItems",
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.