Package org.apache.tapestry.spec

Examples of org.apache.tapestry.spec.IPropertySpecification


        new PersistAnnotationWorker().performEnhancement(op, spec, m, l);

        verifyControls();

        IPropertySpecification ps = spec.getPropertySpecification("clientPersistentProperty");

        assertEquals("client", ps.getPersistence());
        assertEquals("clientPersistentProperty", ps.getName());
        assertSame(l, ps.getLocation());
    }
View Full Code Here


        Iterator i = spec.getPropertySpecificationNames().iterator();

        while (i.hasNext())
        {
            String name = (String) i.next();
            IPropertySpecification ps = spec.getPropertySpecification(name);

            try
            {
                performEnhancement(op, ps);
            }
            catch (RuntimeException ex)
            {
                _errorLog.error(
                        EnhanceMessages.errorAddingProperty(name, op.getBaseClass(), ex),
                        ps.getLocation(),
                        ex);
            }
        }
    }
View Full Code Here

        int count = names.size();

        for (int i = 0; i < count; i++)
        {
            String name = (String) names.get(i);
            IPropertySpecification ps = spec.getPropertySpecification(name);

            String expression = ps.getInitialValue();
            Object initialValue = null;

            // If no initial value expression is provided, then read the current
            // property of the expression.  This may be null, or may be
            // a value set in finishLoad() (via an abstract accessor).

            try
            {
                if (Tapestry.isNull(expression))
                {
                    initialValue = OgnlUtils.get(name, _resolver, component);
                }
                else
                {
                    // Evaluate the expression and update the property.

                    initialValue = OgnlUtils.get(expression, _resolver, component);

                    OgnlUtils.set(name, _resolver, component, initialValue);
                }
            }
            catch (Exception ex)
            {
                throw new ApplicationRuntimeException(
                    Tapestry.format(
                        "PageLoader.unable-to-initialize-property",
                        name,
                        component,
                        ex.getMessage()),
                    ps.getLocation(),
                    ex);
            }

            PageDetachListener initializer =
                new PropertyInitializer(_resolver, component, name, initialValue);
View Full Code Here

        for (int i = 0; i < count; i++)
        {
            String name = (String) names.get(i);

            IPropertySpecification ps = _specification.getPropertySpecification(name);

            scanForSpecifiedProperty(ps);
        }
    }
View Full Code Here

        for (int i = 0; i < count; i++)
        {
            String name = (String) names.get(i);

            IPropertySpecification ps = _specification.getPropertySpecification(name);

            scanForSpecifiedProperty(ps);
        }
    }
View Full Code Here

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

        verifyControls();

        IPropertySpecification ps = spec.getPropertySpecification("clientPersistentProperty");

        assertEquals("client", ps.getPersistence());
        assertEquals("clientPersistentProperty", ps.getName());
    }
View Full Code Here

    {
        List names = new ArrayList();
        Iterator i = propertySpecs.iterator();
        while (i.hasNext())
        {
            IPropertySpecification ps = (IPropertySpecification) i.next();

            names.add(ps.getName());
        }

        MockControl c = newControl(IComponentSpecification.class);
        IComponentSpecification result = (IComponentSpecification) c.getMock();

        result.getPropertySpecificationNames();
        c.setReturnValue(names);

        i = propertySpecs.iterator();
        while (i.hasNext())
        {
            IPropertySpecification ps = (IPropertySpecification) i.next();

            result.getPropertySpecification(ps.getName());
            c.setReturnValue(ps);
        }

        return result;
    }
View Full Code Here

        __CLOVER_194_0.S[4651]++;int count = names.size();

        __CLOVER_194_0.S[4652]++;for (int i = 0; (((i < count) && (++__CLOVER_194_0.CT[850] != 0)) || (++__CLOVER_194_0.CF[850] == 0)); i++){
        {
            __CLOVER_194_0.S[4653]++;String name = (String) names.get(i);
            __CLOVER_194_0.S[4654]++;IPropertySpecification ps = spec.getPropertySpecification(name);
            __CLOVER_194_0.S[4655]++;String expression = ps.getInitialValue();

            __CLOVER_194_0.S[4656]++;PageDetachListener initializer = new PropertyInitializer(component, name, expression, ps.getLocation());

            __CLOVER_194_0.S[4657]++;_propertyInitializers.add(initializer);
            __CLOVER_194_0.S[4658]++;page.addPageDetachListener(initializer);
        }}
View Full Code Here

        pvs.applyValue(finalValue);
    }

    private void endPropertySpecification()
    {
        IPropertySpecification ps = (IPropertySpecification) peekObject();

        String initialValue = getExtendedValue(ps.getInitialValue(), "initial-value", false);

        // In the 3.0 DTD, the initial value was always an OGNL expression.
        // In the 4.0 DTD, it is a binding reference, qualified with a prefix.

        if (initialValue != null && !_DTD_4_0)
            initialValue = BindingConstants.OGNL_PREFIX + ":" + initialValue;

        ps.setInitialValue(initialValue);
    }
View Full Code Here

        else
            persistence = getBooleanAttribute("persistent", false) ? "session" : null;

        String initialValue = getAttribute("initial-value");

        IPropertySpecification ps = _factory.createPropertySpecification();
        ps.setName(name);

        if (HiveMind.isNonBlank(type))
            ps.setType(type);

        ps.setPersistence(persistence);
        ps.setInitialValue(initialValue);

        IComponentSpecification cs = (IComponentSpecification) peekObject();
        cs.addPropertySpecification(ps);

        push(_elementName, ps, STATE_PROPERTY, false);
View Full Code Here

TOP

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

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.