Package org.apache.tapestry.binding

Examples of org.apache.tapestry.binding.BindingFactory


            if (_factoryMap.containsKey(prefix))
                path = reference.substring(colonx + 1);
        }

        BindingFactory factory = (BindingFactory) _factoryMap.get(prefix);

        if (factory == null)
            factory = _literalBindingFactory;

        return factory.createBinding(component, bindingDescription, path, location);
    }
View Full Code Here


    {
        IComponent component = (IComponent) newMock(IComponent.class);
        IBinding binding = (IBinding) newMock(IBinding.class);

        MockControl factoryControl = newControl(BindingFactory.class);
        BindingFactory factory = (BindingFactory) factoryControl.getMock();

        Location l = fabricateLocation(99);

        // Training

        factory.createBinding(component, "foo", "a literal value without a prefix", l);
        factoryControl.setReturnValue(binding);

        replayControls();

        BindingSourceImpl bs = new BindingSourceImpl();
View Full Code Here

    {
        IComponent component = (IComponent) newMock(IComponent.class);
        IBinding binding = (IBinding) newMock(IBinding.class);

        MockControl factoryControl = newControl(BindingFactory.class);
        BindingFactory factory = (BindingFactory) factoryControl.getMock();

        Location l = fabricateLocation(99);

        // Training

        factory.createBinding(component, "foo", "an-expression", l);
        factoryControl.setReturnValue(binding);

        BindingPrefixContribution c = new BindingPrefixContribution();
        c.setPrefix(BindingConstants.OGNL_PREFIX);
        c.setFactory(factory);
View Full Code Here

    {
        IComponent component = (IComponent) newMock(IComponent.class);
        IBinding binding = (IBinding) newMock(IBinding.class);

        MockControl factoryControl = newControl(BindingFactory.class);
        BindingFactory factory = (BindingFactory) factoryControl.getMock();

        Location l = fabricateLocation(99);

        // Training

        factory.createBinding(component, "bar", "path part of locator", l);
        factoryControl.setReturnValue(binding);

        BindingPrefixContribution c = new BindingPrefixContribution();
        c.setPrefix("prefix");
        c.setFactory(factory);
View Full Code Here

    {
        IComponent component = (IComponent) newMock(IComponent.class);
        IBinding binding = (IBinding) newMock(IBinding.class);

        MockControl factoryControl = newControl(BindingFactory.class);
        BindingFactory literalFactory = (BindingFactory) factoryControl.getMock();

        BindingFactory factory = (BindingFactory) newMock(BindingFactory.class);

        Location l = fabricateLocation(99);

        // Training
View Full Code Here

    }

    public IBinding createBinding(IComponent component, String bindingDescription, String reference,
            Location location)
    {
        BindingFactory factory = _literalBindingFactory;
        String path = reference;

        int colonx = reference.indexOf(':');

        if (colonx > 1)
        {
            String prefix = reference.substring(0, colonx);

            BindingFactory prefixedFactory = (BindingFactory) _factoryMap.get(prefix);

            if (prefixedFactory != null)
            {
                factory = prefixedFactory;
                path = reference.substring(colonx + 1);
View Full Code Here

    {
        IComponent component = (IComponent) newMock(IComponent.class);
        IBinding binding = (IBinding) newMock(IBinding.class);

        MockControl factoryControl = newControl(BindingFactory.class);
        BindingFactory factory = (BindingFactory) factoryControl.getMock();

        Location l = fabricateLocation(99);

        // Training

        factory.createBinding(component, "foo", "a literal value without a prefix", l);
        factoryControl.setReturnValue(binding);

        replayControls();

        BindingSourceImpl bs = new BindingSourceImpl();
View Full Code Here

    {
        IComponent component = (IComponent) newMock(IComponent.class);
        IBinding binding = (IBinding) newMock(IBinding.class);

        MockControl factoryControl = newControl(BindingFactory.class);
        BindingFactory factory = (BindingFactory) factoryControl.getMock();

        Location l = fabricateLocation(99);

        // Training

        factory.createBinding(component, "bar", "path part of locator", l);
        factoryControl.setReturnValue(binding);

        BindingPrefixContribution c = new BindingPrefixContribution();
        c.setPrefix("prefix");
        c.setFactory(factory);
View Full Code Here

    {
        IComponent component = (IComponent) newMock(IComponent.class);
        IBinding binding = (IBinding) newMock(IBinding.class);

        MockControl factoryControl = newControl(BindingFactory.class);
        BindingFactory literalFactory = (BindingFactory) factoryControl.getMock();

        BindingFactory factory = (BindingFactory) newMock(BindingFactory.class);

        Location l = fabricateLocation(99);

        // Training
View Full Code Here

{
    public void testNoPrefix()
    {
        IComponent component = newComponent();
        IBinding binding = newBinding();
        BindingFactory factory = newFactory();
        Location l = newLocation();

        BindingPrefixContribution c = new BindingPrefixContribution();
        c.setPrefix(BindingConstants.LITERAL_PREFIX);
        c.setFactory(factory);

        // Training

        factory.createBinding(component, "foo", "a literal value without a prefix", l);
        getControl(factory).setReturnValue(binding);

        replayControls();

        BindingSourceImpl bs = new BindingSourceImpl();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.binding.BindingFactory

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.