Package org.apache.tapestry.spec

Examples of org.apache.tapestry.spec.IParameterSpecification


        __CLOVER_225_0.S[11475]++;push(_elementName, null, STATE_NO_CONTENT);
    } finally { }}

    private void enterParameter()
    {try { __CLOVER_225_0.M[2800]++;
        __CLOVER_225_0.S[11476]++;IParameterSpecification ps = _factory.createParameterSpecification();

        __CLOVER_225_0.S[11477]++;String name = getValidatedAttribute(
                "name",
                PARAMETER_NAME_PATTERN,
                "invalid-parameter-name");

        __CLOVER_225_0.S[11478]++;String propertyName = getValidatedAttribute(
                "property-name",
                PROPERTY_NAME_PATTERN,
                "invalid-property-name");

        __CLOVER_225_0.S[11479]++;if ((((propertyName == null) && (++__CLOVER_225_0.CT[1969] != 0)) || (++__CLOVER_225_0.CF[1969] == 0))){
            __CLOVER_225_0.S[11480]++;propertyName = name;}

        __CLOVER_225_0.S[11481]++;ps.setPropertyName(propertyName);

        __CLOVER_225_0.S[11482]++;ps.setRequired(getBooleanAttribute("required", false));
        __CLOVER_225_0.S[11483]++;ps.setDefaultValue(getAttribute("default-value"));
        __CLOVER_225_0.S[11484]++;ps.setDirection((Direction) getConvertedAttribute("direction", Direction.CUSTOM));

        __CLOVER_225_0.S[11485]++;String type = getAttribute("type"); // Current, 3.0+ DTD

        __CLOVER_225_0.S[11486]++;if ((((type != null) && (++__CLOVER_225_0.CT[1970] != 0)) || (++__CLOVER_225_0.CF[1970] == 0))){
            __CLOVER_225_0.S[11487]++;ps.setType(type);}

        __CLOVER_225_0.S[11488]++;IComponentSpecification cs = (IComponentSpecification) peekObject();

        __CLOVER_225_0.S[11489]++;cs.addParameter(name, ps);
View Full Code Here


        __CLOVER_225_0.S[5402]++;push(_elementName, null, STATE_NO_CONTENT);
    } finally { }}

    private void enterParameter()
    {try { __CLOVER_225_0.M[1150]++;
        __CLOVER_225_0.S[5403]++;IParameterSpecification ps = _factory.createParameterSpecification();

        __CLOVER_225_0.S[5404]++;String name = getValidatedAttribute(
                "name",
                PARAMETER_NAME_PATTERN,
                "invalid-parameter-name");

        __CLOVER_225_0.S[5405]++;String propertyName = getValidatedAttribute(
                "property-name",
                PROPERTY_NAME_PATTERN,
                "invalid-property-name");

        __CLOVER_225_0.S[5406]++;if ((((propertyName == null) && (++__CLOVER_225_0.CT[949] != 0)) || (++__CLOVER_225_0.CF[949] == 0))){
            __CLOVER_225_0.S[5407]++;propertyName = name;}

        __CLOVER_225_0.S[5408]++;ps.setPropertyName(propertyName);

        __CLOVER_225_0.S[5409]++;ps.setRequired(getBooleanAttribute("required", false));
        __CLOVER_225_0.S[5410]++;ps.setDefaultValue(getAttribute("default-value"));
        __CLOVER_225_0.S[5411]++;ps.setDirection((Direction) getConvertedAttribute("direction", Direction.CUSTOM));

        __CLOVER_225_0.S[5412]++;String type = getAttribute("type"); // Current, 3.0+ DTD

        __CLOVER_225_0.S[5413]++;if ((((type != null) && (++__CLOVER_225_0.CT[950] != 0)) || (++__CLOVER_225_0.CF[950] == 0))){
            __CLOVER_225_0.S[5414]++;ps.setType(type);}

        __CLOVER_225_0.S[5415]++;IComponentSpecification cs = (IComponentSpecification) peekObject();

        __CLOVER_225_0.S[5416]++;cs.addParameter(name, ps);
View Full Code Here

        __CLOVER_191_0.S[12652]++;Iterator i = spec.getParameterNames().iterator();

        __CLOVER_191_0.S[12653]++;while ((((i.hasNext()) && (++__CLOVER_191_0.CT[2159] != 0)) || (++__CLOVER_191_0.CF[2159] == 0))){
        {
            __CLOVER_191_0.S[12654]++;String name = (String) i.next();
            __CLOVER_191_0.S[12655]++;IParameterSpecification parameterSpec = spec.getParameter(name);

            __CLOVER_191_0.S[12656]++;String defaultValue = parameterSpec.getDefaultValue();
            __CLOVER_191_0.S[12657]++;if ((((defaultValue == null) && (++__CLOVER_191_0.CT[2160] != 0)) || (++__CLOVER_191_0.CF[2160] == 0))){
                __CLOVER_191_0.S[12658]++;continue;}

            // the parameter has a default value, so it must not be required
            __CLOVER_191_0.S[12659]++;if ((((parameterSpec.isRequired()) && (++__CLOVER_191_0.CT[2161] != 0)) || (++__CLOVER_191_0.CF[2161] == 0))){
                __CLOVER_191_0.S[12660]++;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
            __CLOVER_191_0.S[12661]++;if ((((component.getBinding(name) == null) && (++__CLOVER_191_0.CT[2162] != 0)) || (++__CLOVER_191_0.CF[2162] == 0))){
            {
                __CLOVER_191_0.S[12662]++;IBinding binding = _bindingFactory.createBinding(
                        component,
                        defaultValue,
                        parameterSpec.getLocation());

                __CLOVER_191_0.S[12663]++;component.setBinding(name, binding);
            }}

        }}
View Full Code Here

    {try { __CLOVER_203_0.M[3101]++;
        __CLOVER_203_0.S[12879]++;_component = component;
        __CLOVER_203_0.S[12880]++;_parameterName = parameterName;
        __CLOVER_203_0.S[12881]++;_binding = binding;

        __CLOVER_203_0.S[12882]++;IParameterSpecification pspec = _component.getSpecification().getParameter(_parameterName);
        __CLOVER_203_0.S[12883]++;_required = pspec.isRequired();
        __CLOVER_203_0.S[12884]++;_propertyName = pspec.getPropertyName();
        __CLOVER_203_0.S[12885]++;_direction = pspec.getDirection();

        __CLOVER_203_0.S[12886]++;_clearValue = readCurrentPropertyValue();
    } finally { }}
View Full Code Here

        __CLOVER_225_0.S[13280]++;push(_elementName, null, STATE_NO_CONTENT);
    } finally { }}

    private void enterParameter()
    {try { __CLOVER_225_0.M[3154]++;
        __CLOVER_225_0.S[13281]++;IParameterSpecification ps = _factory.createParameterSpecification();

        __CLOVER_225_0.S[13282]++;String name = getValidatedAttribute(
                "name",
                PARAMETER_NAME_PATTERN,
                "invalid-parameter-name");

        __CLOVER_225_0.S[13283]++;String propertyName = getValidatedAttribute(
                "property-name",
                PROPERTY_NAME_PATTERN,
                "invalid-property-name");

        __CLOVER_225_0.S[13284]++;if ((((propertyName == null) && (++__CLOVER_225_0.CT[2237] != 0)) || (++__CLOVER_225_0.CF[2237] == 0))){
            __CLOVER_225_0.S[13285]++;propertyName = name;}

        __CLOVER_225_0.S[13286]++;ps.setPropertyName(propertyName);

        __CLOVER_225_0.S[13287]++;ps.setRequired(getBooleanAttribute("required", false));
        __CLOVER_225_0.S[13288]++;ps.setDefaultValue(getAttribute("default-value"));
        __CLOVER_225_0.S[13289]++;ps.setDirection((Direction) getConvertedAttribute("direction", Direction.CUSTOM));

        __CLOVER_225_0.S[13290]++;String type = getAttribute("type"); // Current, 3.0+ DTD

        __CLOVER_225_0.S[13291]++;if ((((type != null) && (++__CLOVER_225_0.CT[2238] != 0)) || (++__CLOVER_225_0.CF[2238] == 0))){
            __CLOVER_225_0.S[13292]++;ps.setType(type);}

        __CLOVER_225_0.S[13293]++;IComponentSpecification cs = (IComponentSpecification) peekObject();

        __CLOVER_225_0.S[13294]++;cs.addParameter(name, ps);
View Full Code Here

        __CLOVER_106_0.S[2589]++;for (int i = 0; (((i < count) && (++__CLOVER_106_0.CT[480] != 0)) || (++__CLOVER_106_0.CF[480] == 0)); i++){
        {
            __CLOVER_106_0.S[2590]++;String name = (String) names.get(i);

            __CLOVER_106_0.S[2591]++;IParameterSpecification ps = _specification.getParameter(name);

            __CLOVER_106_0.S[2592]++;scanForBindingProperty(name, ps);

            __CLOVER_106_0.S[2593]++;scanForParameterProperty(name, ps);
        }}
View Full Code Here

    public void testValidParameterName() throws Exception
    {
        IComponentSpecification spec = parseComponent("ValidParameterName.jwc");

        IParameterSpecification ps = spec.getParameter("valid");

        assertNotNull("Parameter specification.", ps);
        checkLine(ps, 24);
    }
View Full Code Here

    public void testParameter_3_0() throws Exception
    {
        IComponentSpecification spec = parseComponent("Parameter_3_0.jwc");

        IParameterSpecification ps = spec.getParameter("noDefault");

        assertEquals("noDefault", ps.getPropertyName());
        assertEquals("noDefault", ps.getParameterName());
        assertEquals(true, ps.isRequired());
        assertEquals("bar", ps.getType());
        assertNull(ps.getDefaultValue());
        assertEquals(false, ps.isDeprecated());

        ps = spec.getParameter("withDefault");
        assertEquals("withDefault", ps.getParameterName());
        assertNull(ps.getType());
        assertEquals(false, ps.isRequired());

        // For 3.0 DTDs, where the default value was always an OGNL expression,
        // the parser will provide the "ognl:" prefix.

        assertEquals("ognl:an.expression", ps.getDefaultValue());

        ps = spec.getParameter("withDescription");
        assertEquals("A parameter with a description.", ps.getDescription());

        ps = spec.getParameter("altName");
        assertEquals("altNameParameter", ps.getPropertyName());

        ps = spec.getParameter("directionIn");
        assertEquals(true, ps.getCache());

        ps = spec.getParameter("directionAuto");
        assertEquals(false, ps.getCache());
    }
View Full Code Here

    public void testParameter() throws Exception
    {
        IComponentSpecification spec = parseComponent("Parameter.jwc");

        IParameterSpecification ps = spec.getParameter("noDefault");

        assertNull(ps.getDefaultValue());
        assertEquals(true, ps.getCache());
        assertTrue(ps.getAliasNames().isEmpty());
        assertEquals(false, ps.isDeprecated());

        ps = spec.getParameter("literalDefault");

        assertEquals("literal-value", ps.getDefaultValue());

        ps = spec.getParameter("expressionDefault");

        assertEquals("ognl:an.expression", ps.getDefaultValue());

        ps = spec.getParameter("noCache");
        assertEquals(false, ps.getCache());

        ps = spec.getParameter("withAliases");
        assertListsEqual(new String[]
        { "fred", "barney" }, ps.getAliasNames().toArray());

        assertSame(ps, spec.getParameter("fred"));
        assertSame(ps, spec.getParameter("barney"));

        ps = spec.getParameter("deprecated");
        assertEquals(true, ps.isDeprecated());
    }
View Full Code Here

        while (i.hasNext())
        {
            String name = (String) i.next();

            IParameterSpecification pspec = spec.getParameter(name);

            boolean isFormal = pspec != null;

            String parameterName = isFormal ? pspec.getParameterName() : name;

            IBindingSpecification bspec = contained.getBinding(name);

            // If not allowing informal parameters, check that each binding
            // matches
            // a formal parameter.

            if (formalOnly && !isFormal)
                throw new ApplicationRuntimeException(PageloadMessages.formalParametersOnly(
                        component,
                        name), component, bspec.getLocation(), null);

            // If an informal parameter that conflicts with a reserved name,
            // then skip it.

            if (!isFormal && spec.isReservedParameterName(name))
                continue;

            if (isFormal)
            {
                if (!name.equals(parameterName))
                {
                    _log.error(PageloadMessages.usedParameterAlias(
                            contained,
                            name,
                            parameterName,
                            bspec.getLocation()));
                }
                else if (pspec.isDeprecated())
                    _log.error(PageloadMessages.deprecatedParameter(
                            name,
                            bspec.getLocation(),
                            contained.getType()));
            }
View Full Code Here

TOP

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

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.