Package org.apache.tapestry5

Examples of org.apache.tapestry5.Binding


                            .getComponentResources();

                    ComponentPageElement embeddedElement = pageAssembly.createdElement.peek();
                    InternalComponentResources embeddedResources = embeddedElement.getComponentResources();

                    Binding binding = elementFactory.newBinding(parameterName, containerResources, embeddedResources,
                            defaultBindingPrefix, parameterValue, location);

                    binder.bind(embeddedElement, binding);
                }
            }
View Full Code Here


            String parameterName, String containerParameterName)
    {
        // TODO: This assumes that the two parameters are both on the core component and not on
        // a mixin. I think this could be improved with more static analysis.

        Binding containerBinding = container.getBinding(containerParameterName);

        if (containerBinding == null)
            return;

        // This helps with debugging, and re-orients any thrown exceptions
View Full Code Here

                                    parameterName));

                            // Otherwise, construct a default binding, or use one provided from
                            // the component.

                            Binding binding = getDefaultBindingForParameter();

                            logger.debug(String.format("%s parameter %s bound to default %s", icr.getCompleteId(),
                                    parameterName, binding));

                            if (binding != null)
View Full Code Here

        return InternalUtils.sortedKeys(getInformalParameterBindings());
    }

    public <T> T getInformalParameter(String name, Class<T> type)
    {
        Binding binding = getBinding(name);

        Object value = binding == null ? null : binding.get();

        return elementResources.coerce(value, type);
    }
View Full Code Here

        return getBinding(parameterName) != null;
    }

    public <T extends Annotation> T getParameterAnnotation(String parameterName, Class<T> annotationType)
    {
        Binding binding = getBinding(parameterName);

        return binding == null ? null : binding.getAnnotation(annotationType);
    }
View Full Code Here

        bindings.put(parameterName, binding);
    }

    public Class getBoundType(String parameterName)
    {
        Binding binding = getBinding(parameterName);

        return binding == null ? null : binding.getBindingType();
    }
View Full Code Here

        return InternalUtils.get(bindings, parameterName);
    }

    public AnnotationProvider getAnnotationProvider(String parameterName)
    {
        Binding binding = getBinding(parameterName);

        return binding == null ? NULL_ANNOTATION_PROVIDER : binding;
    }
View Full Code Here

        conduits.put(parameterName, conduit);
    }

    public String getPropertyName(String parameterName)
    {
        Binding binding = getBinding(parameterName);

        if (binding == null)
            return null;

        if (binding instanceof InternalPropBinding) { return ((InternalPropBinding) binding).getPropertyName(); }
View Full Code Here

        transformation.getOrCreateMethod(TransformConstants.CONTAINING_PAGE_DID_LOAD_SIGNATURE).addAdvice(
                new ComponentMethodAdvice()
                {
                    public void advise(ComponentMethodInvocation invocation)
                    {
                        Binding binding = bindingSource.newBinding("@Cached watch", invocation.getComponentResources(),
                                BindingConstants.PROP, watch);

                        bindingAccess.write(invocation.getInstance(), binding);

                        invocation.proceed();
                    }
                });

        return new MethodResultCacheFactory()
        {
            public MethodResultCache create(Component instance)
            {
                Binding binding = (Binding) bindingAccess.read(instance);

                return new WatchedBindingMethodResultCache(binding);
            }
        };
    }
View Full Code Here

    {
        if (value == null) return;

        if (value instanceof Binding)
        {
            Binding binding = (Binding) value;

            resources.bindParameter(parameterName, binding);
            return;
        }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.Binding

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.