Package org.apache.tapestry.spec

Examples of org.apache.tapestry.spec.IComponentSpecification


        InjectSpecification spec = _factory.createInjectSpecification();

        spec.setProperty(property);
        spec.setType(type);
        spec.setObject(objectReference);
        IComponentSpecification cs = (IComponentSpecification) peekObject();

        cs.addInjectSpecification(spec);

        push(_elementName, spec, STATE_NO_CONTENT);
    }
View Full Code Here


    }

    private void enterReservedParameter()
    {
        String name = getAttribute("name");
        IComponentSpecification cs = (IComponentSpecification) peekObject();

        cs.addReservedParameterName(name);

        push(_elementName, null, STATE_NO_CONTENT);
    }
View Full Code Here

        Collection names = source.getBindingNames();

        if (names == null)
            return;

        IComponentSpecification specification = source.getSpecification();
        Iterator i = names.iterator();

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

            // If not a formal parameter, then copy it over.

            if (specification.getParameter(name) == null)
            {
                IBinding binding = source.getBinding(name);

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

     *            {@link IComponentSpecification}).
     */

    private void bind(IComponent container, IComponent component, IContainedComponent contained)
    {
        IComponentSpecification spec = component.getSpecification();
        boolean formalOnly = !spec.getAllowInformalParameters();

        IComponentSpecification containerSpec = container.getSpecification();
        boolean containerFormalOnly = !containerSpec.getAllowInformalParameters();

        if (contained.getInheritInformalParameters())
        {
            if (formalOnly)
                throw new ApplicationRuntimeException(PageloadMessages
View Full Code Here

                String type = contained.getType();
                Location location = contained.getLocation();

                _componentResolver.resolve(cycle, namespace, type, location);

                IComponentSpecification componentSpecification = _componentResolver
                        .getSpecification();
                INamespace componentNamespace = _componentResolver.getNamespace();

                // Instantiate the contained component.
View Full Code Here

        IPage page = container.getPage();

        _componentResolver.resolve(cycle, container.getNamespace(), componentType, location);

        INamespace componentNamespace = _componentResolver.getNamespace();
        IComponentSpecification spec = _componentResolver.getSpecification();

        IComponent result = instantiateComponent(
                page,
                container,
                componentId,
View Full Code Here

            install();
           
            return;
        }

        IComponentSpecification specification = getDelegate().findComponentSpecification(
                cycle,
                namespace,
                _type);
       
        setSpecification(specification);
View Full Code Here

    }

    private void install()
    {
        INamespace namespace = getNamespace();
        IComponentSpecification specification = getSpecification();

        if (_log.isDebugEnabled())
            _log.debug(ResolverMessages.installingComponent(_type, namespace, specification));

        namespace.installComponentSpecification(_type, specification);
View Full Code Here

    private void connectInformalBinding(
        IComponent container,
        IComponent component,
        String bindingName)
    {
        IComponentSpecification componentSpec = component.getSpecification();
        IComponentSpecification containerSpec = container.getSpecification();

        // check if binding already exists in the component
        if (component.getBinding(bindingName) != null)
            return;

        // check if parameter is informal for the component
        if (componentSpec.getParameter(bindingName) != null
            || componentSpec.isReservedParameterName(bindingName))
            return;

        // check if parameter is informal for the container
        if (containerSpec.getParameter(bindingName) != null
            || containerSpec.isReservedParameterName(bindingName))
            return;

        // if everything passes, establish binding
        IBinding binding = container.getBinding(bindingName);
        component.setBinding(bindingName, binding);
View Full Code Here

    private void removeBeans(BeanLifecycle lifecycle)
    {
        if (_beans == null)
            return;

        IComponentSpecification spec = null;

        Iterator i = _beans.entrySet().iterator();
        while (i.hasNext())
        {
            Map.Entry e = (Map.Entry) i.next();
            String name = (String) e.getKey();

            if (spec == null)
                spec = _component.getSpecification();

            IBeanSpecification s = spec.getBeanSpecification(name);

            if (s.getLifecycle() == lifecycle)
            {
                Object bean = e.getValue();
View Full Code Here

TOP

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

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.