Package org.apache.tapestry

Examples of org.apache.tapestry.IBeanProvider


        return super.hasGetProperty(context, target, oname);
    }
   
    public Class getPropertyClass(OgnlContext context, Object target, Object name)
    {
        IBeanProvider provider = (IBeanProvider)target;
        String beanName = ((String)name).replaceAll("\"", "");
       
        if (provider.canProvideBean(beanName))
            return provider.getBean(beanName).getClass();
       
        return super.getPropertyClass(context, target, name);
    }
View Full Code Here


        return super.getPropertyClass(context, target, name);
    }
   
    public String getSourceAccessor(OgnlContext context, Object target, Object name)
    {
        IBeanProvider provider = (IBeanProvider)target;
        String beanName = ((String)name).replaceAll("\"", "");
       
        if (provider.canProvideBean(beanName)) {
           
            Class type = OgnlRuntime.getCompiler().getInterfaceClass(provider.getBean(beanName).getClass());
           
            ExpressionCompiler.addCastString(context, "((" + type.getName() + ")");
           
            context.setCurrentAccessor(IBeanProvider.class);
            context.setCurrentType(type);
View Full Code Here

    {
        ValueConverter vc = newMock(ValueConverter.class);
       
        IComponent component = newComponent();
       
        IBeanProvider beanProvider = newMock(IBeanProvider.class);

        Location l = fabricateLocation(21);

        Object bean = new Object();

        expect(component.getBeans()).andReturn(beanProvider);

        expect(beanProvider.getBean("fred")).andReturn(bean);

        replay();

        BeanBinding binding = new BeanBinding("param", vc, l, component, "fred");
View Full Code Here

    }

    private IBeanProvider newBeanProvider(String beanName, Object bean)
    {
        MockControl control = newControl(IBeanProvider.class);
        IBeanProvider provider = (IBeanProvider) control.getMock();

        provider.getBean(beanName);
        control.setReturnValue(bean);

        return provider;
    }
View Full Code Here

    }

    public void testBeanReference() throws Exception
    {
        Validator validator = newValidator();
        IBeanProvider provider = newBeanProvider("fred", validator);
        IComponent component = newComponent(provider);

        IFormComponent field = newField();
        ValidationMessages messages = newMessages();
        Object value = new Object();
View Full Code Here

    }

    public void testBeanReferenceNotValidator()
    {
        Object bean = new Object();
        IBeanProvider provider = newBeanProvider("fred", bean);
        IComponent component = newComponent(provider);

        replayControls();

        ValidatorFactoryImpl vf = new ValidatorFactoryImpl();
View Full Code Here

     *
     **/
   
    public Object getProperty(Map context, Object target, Object name) throws OgnlException
    {
        IBeanProvider provider = (IBeanProvider)target;
        String beanName = (String)name;
       
        if (provider.canProvideBean(beanName))
            return provider.getBean(beanName);
       
        return super.getProperty(context, target, name);
    }
View Full Code Here

     *
     **/
   
    public boolean hasGetProperty(Map context, Object target, Object oname) throws OgnlException
    {
        IBeanProvider provider = (IBeanProvider)target;
        String beanName = (String)oname;

        if (provider.canProvideBean(beanName))
            return true;
           
        return super.hasGetProperty(context, target, oname);
    }
View Full Code Here

     *
     **/
   
    public Object getProperty(Map context, Object target, Object name) throws OgnlException
    {
        IBeanProvider provider = (IBeanProvider)target;
        String beanName = (String)name;
       
        if (provider.canProvideBean(beanName))
            return provider.getBean(beanName);
       
        return super.getProperty(context, target, name);
    }
View Full Code Here

     *
     **/
   
    public boolean hasGetProperty(Map context, Object target, Object oname) throws OgnlException
    {
        IBeanProvider provider = (IBeanProvider)target;
        String beanName = (String)oname;

        if (provider.canProvideBean(beanName))
            return true;
           
        return super.hasGetProperty(context, target, oname);
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.IBeanProvider

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.