Examples of IPropertySpecification


Examples of org.apache.tapestry.spec.IPropertySpecification

    PropertyPersistenceStrategy findStrategy(IComponent component,
            String propertyName)
    {
        // So much for Law of Demeter!

        IPropertySpecification propertySpecification = component
                .getSpecification().getPropertySpecification(propertyName);

        if (propertySpecification == null)
        {
            _log.error(RecordMessages.missingPropertySpecification(
                    propertyName, component), null, null);
            return null;
        }

        String name = propertySpecification.getPersistence();

        // Should check for nulls, but the architecture of the framework pretty
        // much
        // ensures that we won't get here unless there is a property
        // and a persistence value for the property.

        try
        {
            return _strategySource.getStrategy(name);
        }
        catch (ApplicationRuntimeException ex)
        {
            _log
                    .error(ex.getMessage(),
                            propertySpecification.getLocation(), ex);

            return null;
        }
    }
View Full Code Here

Examples of org.apache.tapestry.spec.IPropertySpecification

        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

Examples of org.apache.tapestry.spec.IPropertySpecification

        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

Examples of org.apache.tapestry.spec.IPropertySpecification

        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 && !_dtd40)
            initialValue = BindingConstants.OGNL_PREFIX + ":" + initialValue;

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

Examples of org.apache.tapestry.spec.IPropertySpecification

        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

Examples of org.apache.tapestry.spec.IPropertySpecification

        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

Examples of org.apache.tapestry.spec.IPropertySpecification

        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

Examples of org.apache.tapestry.spec.IPropertySpecification

    PropertyPersistenceStrategy findStrategy(IComponent component, String propertyName)
    {
        // So much for Law of Demeter!

        IPropertySpecification propertySpecification = component.getSpecification()
                .getPropertySpecification(propertyName);

        if (propertySpecification == null)
        {
            _log.error(
                    RecordMessages.missingPropertySpecification(propertyName, component),
                    null,
                    null);
            return null;
        }

        String name = propertySpecification.getPersistence();

        // Should check for nulls, but the architecture of the framework pretty much
        // ensures that we won't get here unless there is a property
        // and a persistence value for the property.

        try
        {
            return _strategySource.getStrategy(name);
        }
        catch (ApplicationRuntimeException ex)
        {
            _log.error(ex.getMessage(), propertySpecification.getLocation(), ex);

            return null;
        }
    }
View Full Code Here

Examples of org.apache.tapestry.spec.IPropertySpecification

    {
        MockControl specc = newControl(IComponentSpecification.class);
        IComponentSpecification spec = (IComponentSpecification) specc.getMock();

        MockControl psc = newControl(IPropertySpecification.class);
        IPropertySpecification ps = (IPropertySpecification) psc.getMock();

        spec.getPropertySpecification(propertyName);
        specc.setReturnValue(ps);

        ps.getPersistence();
        psc.setReturnValue(persistence);

        return spec;
    }
View Full Code Here

Examples of org.apache.tapestry.spec.IPropertySpecification

        MockControl specc = newControl(IComponentSpecification.class);
        IComponentSpecification spec = (IComponentSpecification) specc.getMock();

        MockControl psc = newControl(IPropertySpecification.class);
        IPropertySpecification ps = (IPropertySpecification) psc.getMock();

        component.getSpecification();
        componentc.setReturnValue(spec);

        spec.getPropertySpecification("zip");
        specc.setReturnValue(ps);

        ps.getPersistence();
        psc.setReturnValue("unknown");

        source.getStrategy("unknown");
        sourcec.setThrowable(inner);

        ps.getLocation();
        psc.setReturnValue(l);

        log.error("Simulated error.", l, inner);

        replayControls();
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.