Examples of IParameterSpecification


Examples of org.apache.tapestry.spec.IParameterSpecification

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

        while (i.hasNext())
        {
            String name = (String) i.next();
            IParameterSpecification parameterSpec = spec.getParameter(name);

            String defaultValue = parameterSpec.getDefaultValue();
            if (defaultValue == null)
                continue;

            // the parameter has a default value, so it must not be required
            if (parameterSpec.isRequired())
                throw new ApplicationRuntimeException(PageloadMessages
                        .parameterMustHaveNoDefaultValue(component, name), component, parameterSpec
                        .getLocation(), null);

            // if there is no binding for this parameter, bind it to the default value.
            // In 3.0, default-value as always an OGNL expression, but now its a locator.

            if (component.getBinding(name) == null)
            {
                String description = PageloadMessages.defaultParameterName(name);

                IBinding binding = _bindingSource.createBinding(
                        component,
                        description,
                        defaultValue,
                        parameterSpec.getLocation());

                component.setBinding(name, binding);
            }
        }
    }
View Full Code Here

Examples of org.apache.tapestry.spec.IParameterSpecification

        Iterator i = spec.getParameterNames().iterator();
        while (i.hasNext())
        {
            String name = (String) i.next();

            IParameterSpecification ps = spec.getParameter(name);

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

Examples of org.apache.tapestry.spec.IParameterSpecification

        Iterator i = spec.getParameterNames().iterator();
        while(i.hasNext())
        {
            String name = (String) i.next();

            IParameterSpecification ps = spec.getParameter(name);

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

Examples of org.apache.tapestry.spec.IParameterSpecification

    public void testSimple()
    {
        Location l = newLocation();

        IParameterSpecification ps = attempt("simpleParameter", l);

        assertListEquals(new Object[] {}, ps.getAliasNames().toArray());
        assertEquals(true, ps.getCache());
        assertEquals(null, ps.getDefaultValue());
        assertEquals(null, ps.getDescription());
        assertSame(l, ps.getLocation());
        assertEquals("simpleParameter", ps.getParameterName());
        assertEquals("simpleParameter", ps.getPropertyName());
        assertEquals("java.lang.String", ps.getType());
    }
View Full Code Here

Examples of org.apache.tapestry.spec.IParameterSpecification

        assertEquals("java.lang.String", ps.getType());
    }

    public void testRequired()
    {
        IParameterSpecification ps = attempt("requiredParameter", null);

        assertEquals(true, ps.isRequired());
    }
View Full Code Here

Examples of org.apache.tapestry.spec.IParameterSpecification

        assertEquals(true, ps.isRequired());
    }

    public void testCacheOff()
    {
        IParameterSpecification ps = attempt("nonCachedParameter", null);

        assertEquals(false, ps.getCache());
    }
View Full Code Here

Examples of org.apache.tapestry.spec.IParameterSpecification

        assertEquals(false, ps.getCache());
    }

    public void testAliases()
    {
        IParameterSpecification ps = attempt("aliasedParameter", null);

        assertListEquals(new String[]{ "fred" }, ps.getAliasNames().toArray());
    }
View Full Code Here

Examples of org.apache.tapestry.spec.IParameterSpecification

        assertListEquals(new String[]{ "fred" }, ps.getAliasNames().toArray());
    }

    public void testDeprecated()
    {
        IParameterSpecification ps = attempt("deprecatedParameter", null);
        assertEquals(true, ps.isDeprecated());
    }
View Full Code Here

Examples of org.apache.tapestry.spec.IParameterSpecification

        assertEquals(true, ps.isDeprecated());
    }

    public void testNamed()
    {
        IParameterSpecification ps = attempt("namedParameter", "fred", null);

        assertEquals("fred", ps.getParameterName());
        assertEquals("namedParameter", ps.getPropertyName());
    }
View Full Code Here

Examples of org.apache.tapestry.spec.IParameterSpecification

        assertEquals("namedParameter", ps.getPropertyName());
    }

    public void testDefaultValue()
    {
        IParameterSpecification ps = attempt("defaultValue", null);

        assertEquals("myDefault", ps.getDefaultValue());
    }
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.