Examples of ParameterModel


Examples of org.apache.tapestry5.model.ParameterModel

        for (String name : model.getParameterNames())
        {
            if (resource.isBound(name))
                continue;

            ParameterModel parameterModel = model.getParameterModel(name);

            if (parameterModel.isRequired())
            {
                String fullName = prefix == null ? name : prefix + "." + name;

                unbound.add(fullName);
            }
View Full Code Here

Examples of org.apache.tapestry5.model.ParameterModel

        String parameterName = "value";

        model.addParameter(parameterName, true, true, BindingConstants.PROP);

        ParameterModel pm = model.getParameterModel(parameterName);

        assertEquals(pm.getName(), parameterName);
        assertEquals(true, pm.isRequired());
        assertEquals(pm.getDefaultBindingPrefix(), BindingConstants.PROP);

        assertEquals(model.getDeclaredParameterNames(), Arrays.asList(parameterName));

        // Verify that the binding prefix is actually stored:
View Full Code Here

Examples of org.apache.tapestry5.model.ParameterModel

        for (String name : model.getParameterNames())
        {
            if (resource.isBound(name)) continue;

            ParameterModel parameterModel = model.getParameterModel(name);

            if (parameterModel.isRequired())
            {
                String fullName = prefix == null ? name : prefix + "." + name;

                unbound.add(fullName);
            }
View Full Code Here

Examples of org.apache.tapestry5.model.ParameterModel

            if (mixinResources == null) throw new TapestryException(
                    StructureMessages.missingMixinForParameter(completeId, mixinName, parameterName), null, null);

            String simpleName = parameterName.substring(dotx + 1);

            ParameterModel pm = mixinResources.getComponentModel().getParameterModel(simpleName);

            return pm != null ? pm.getDefaultBindingPrefix() : null;
        }

        // A formal parameter of the core component?

        ParameterModel pm = coreResources.getComponentModel().getParameterModel(parameterName);

        if (pm != null) return pm.getDefaultBindingPrefix();

        // Search for mixin that it is a formal parameter of

        for (String mixinName : InternalUtils.sortedKeys(mixinIdToComponentResources))
        {
            InternalComponentResources resources = mixinIdToComponentResources.get(mixinName);

            pm = resources.getComponentModel().getParameterModel(parameterName);

            if (pm != null) return pm.getDefaultBindingPrefix();
        }

        // Not a formal parameter of the core component or any mixin.

        return null;
View Full Code Here

Examples of org.apache.tapestry5.model.ParameterModel

    private ParameterAccess createParameterAccess(final String parameterName)
    {
        final Binding binding = getBinding(parameterName);

        ParameterModel parameterModel = getComponentModel().getParameterModel(parameterName);

        final boolean allowNull = parameterModel == null ? true : parameterModel.isAllowNull();

        return new ParameterAccess()
        {
            public boolean isBound()
            {
View Full Code Here

Examples of org.apache.tapestry5.model.ParameterModel

        ComponentPageElement element = mockComponentPageElement();
        Component component = mockComponent();
        Instantiator ins = mockInstantiator(component);
        MarkupWriter writer = mockMarkupWriter();
        ComponentModel model = mockComponentModel();
        ParameterModel pmodel = mockParameterModel();
        Binding binding = mockBinding();

        train_getModel(ins, model);

        train_getParameterModel(model, "fred", pmodel);
View Full Code Here

Examples of org.apache.tapestry5.model.ParameterModel

        for (String name : model.getParameterNames())
        {
            if (resource.isBound(name))
                continue;

            ParameterModel parameterModel = model.getParameterModel(name);

            if (parameterModel.isRequired())
            {
                String fullName = prefix == null ? name : prefix + "." + name;

                unbound.add(fullName);
            }
View Full Code Here

Examples of org.apache.tapestry5.model.ParameterModel

        addParameter(name, required, allowNull, defaultBindingPrefix, false);
    }

    public ParameterModel getParameterModel(String parameterName)
    {
        ParameterModel result = InternalUtils.get(parameters, parameterName.toLowerCase());

        if (result == null && parentModel != null)
            result = parentModel.getParameterModel(parameterName);

        return result;
View Full Code Here

Examples of org.apache.tapestry5.model.ParameterModel

    private ParameterAccess createParameterAccess(final String parameterName)
    {
        final Binding binding = getBinding(parameterName);

        ParameterModel parameterModel = getComponentModel().getParameterModel(parameterName);

        final boolean allowNull = parameterModel == null ? true : parameterModel.isAllowNull();

        return new ParameterAccess()
        {
            public boolean isBound()
            {
View Full Code Here

Examples of org.apache.tapestry5.model.ParameterModel

        for (String name : model.getParameterNames())
        {
            if (resource.isBound(name)) continue;

            ParameterModel parameterModel = model.getParameterModel(name);

            if (parameterModel.isRequired())
            {
                String fullName = prefix == null ? name : prefix + "." + name;

                unbound.add(fullName);
            }
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.