Package org.apache.tapestry.spec

Examples of org.apache.tapestry.spec.IBeanSpecification


            String name = (String) e.getKey();

            if (spec == null)
                spec = _component.getSpecification();

            IBeanSpecification s = spec.getBeanSpecification(name);

            if (s.getLifecycle() == lifecycle)
            {
                Object bean = e.getValue();

                if (LOG.isDebugEnabled())
                    LOG.debug("Removing " + lifecycle.getName() + " bean " + name + ": " + bean);
View Full Code Here


        String propertyName = getValidatedAttribute(
                "property",
                PROPERTY_NAME_PATTERN,
                "invalid-property-name");

        IBeanSpecification bs = _factory.createBeanSpecification();

        bs.setClassName(className);
        bs.setLifecycle(lifecycle);
        bs.setPropertyName(propertyName);

        if (commax > 0)
        {
            String initializer = classAttribute.substring(commax + 1);
            bs.addInitializer(new LightweightBeanInitializer(initializer));
        }

        IComponentSpecification cs = (IComponentSpecification) peekObject();

        cs.addBeanSpecification(name, bs);
View Full Code Here

        bi.setPropertyName(name);
        bi.setBindingReference(BindingConstants.MESSAGE_PREFIX + ":" + key);
        bi.setLocation(getLocation());

        IBeanSpecification bs = (IBeanSpecification) peekObject();

        bs.addInitializer(bi);

        push(_elementName, null, STATE_NO_CONTENT);
    }
View Full Code Here

        BindingBeanInitializer bi = _factory.createBindingBeanInitializer(_bindingSource);

        bi.setPropertyName(name);

        IBeanSpecification bs = (IBeanSpecification) peekObject();

        push(_elementName, new BeanSetPropertySetter(bs, bi, null, reference), STATE_SET, false);
    }
View Full Code Here

        BindingBeanInitializer bi = _factory.createBindingBeanInitializer(_bindingSource);

        bi.setPropertyName(name);

        IBeanSpecification bs = (IBeanSpecification) peekObject();

        push(_elementName, new BeanSetPropertySetter(bs, bi, BindingConstants.OGNL_PREFIX + ":",
                expression), STATE_SET, false);
    }
View Full Code Here

        BeanProvider bp = new BeanProvider(component);

        verifyControls();

        IBeanSpecification bs = newBeanSpec();

        trainGetClassName(bs, "org.foo.Bar");

        trainFindClass(finder, "org.foo.Bar", null);
View Full Code Here

        BeanProvider bp = new BeanProvider(component);

        verifyControls();

        IBeanSpecification bs = newBeanSpec();

        trainGetClassName(bs, "org.foo.Bar");

        trainFindClass(finder, "org.foo.Bar", InstantiateFailureBean.class);
View Full Code Here

        String className = TargetBean.class.getName();

        trainFindClass(finder, className, TargetBean.class);

        IBeanSpecification spec = new BeanSpecification();
        spec.setClassName(className);

        RuntimeException t = new RuntimeException("Blat!");

        Location l = newLocation();

        IBeanInitializer bi = new BeanInitializerFixture("foo", t);
        bi.setLocation(l);

        spec.addInitializer(bi);

        trainGetExtendedId(component, "Fred/barney");

        replayControls();
View Full Code Here

        new BeanAnnotationWorker().performEnhancement(op, spec, m);

        verifyControls();

        IBeanSpecification bs = spec.getBeanSpecification("mapBean");

        assertEquals("mapBean", bs.getPropertyName());
        assertEquals(HashMap.class.getName(), bs.getClassName());
        assertEquals(BeanLifecycle.REQUEST, bs.getLifecycle());
        assertNull(bs.getLocation());
        assertNull(bs.getInitializers());
    }
View Full Code Here

        new BeanAnnotationWorker().performEnhancement(op, spec, m);

        verifyControls();

        IBeanSpecification bs = spec.getBeanSpecification("hashMapBean");

        assertEquals("hashMapBean", bs.getPropertyName());
        assertEquals(HashMap.class.getName(), bs.getClassName());
        assertEquals(BeanLifecycle.REQUEST, bs.getLifecycle());
        assertNull(bs.getLocation());
        assertNull(bs.getInitializers());
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.spec.IBeanSpecification

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.