Package org.apache.commons.beanutils

Examples of org.apache.commons.beanutils.ConvertingWrapDynaBean


    // DynaTag interface
    //-------------------------------------------------------------------------                   
    public void beforeSetAttributes() throws Exception {
        // create a new dynabean before the attributes are set
        bean = factory.newInstance();
        setDynaBean( new ConvertingWrapDynaBean( bean ) );
    }
View Full Code Here


                    dynaTag.setAttribute(name, value);
                }
            }
            else {
                // treat the tag as a bean
                DynaBean dynaBean = new ConvertingWrapDynaBean( tag );
                for (Iterator iter = attributes.entrySet().iterator(); iter.hasNext();) {
                    Map.Entry entry = (Map.Entry) iter.next();
                    String name = (String) entry.getKey();
                    Expression expression = (Expression) entry.getValue();
       
                    Object value = expression.evaluate(context);
                    dynaBean.set(name, value);
                }
            }
       
            tag.doTag(output);
        }
View Full Code Here

    }

    public void beforeSetAttributes() throws Exception {
        // create a new dynabean before the attributes are set
        bean = beanClass.newInstance();
        setDynaBean( new ConvertingWrapDynaBean( bean ) );

        setAttributesSet.clear();                   
    }
View Full Code Here

                    dynaTag.setAttribute(name, value);
                }
            }
            else {
                // treat the tag as a bean
                DynaBean dynaBean = new ConvertingWrapDynaBean( tag );
                for (Iterator iter = attributes.entrySet().iterator(); iter.hasNext();) {
                    Map.Entry entry = (Map.Entry) iter.next();
                    String name = (String) entry.getKey();
                    Expression expression = (Expression) entry.getValue();

                    DynaProperty property = dynaBean.getDynaClass().getDynaProperty(name);
                    if (property == null) {
                        throw new JellyException("This tag does not understand the '" + name + "' attribute" );
                    }
                    Class type = property.getType();

                    Object value = null;
                    if (type.isAssignableFrom(Expression.class) && !type.isAssignableFrom(Object.class)) {
                        value = expression;
                    }
                    else {
                        value = expression.evaluateRecurse(context);
                    }
                    dynaBean.set(name, value);
                }
            }

            tag.doTag(output);
        }
View Full Code Here

    public void beforeSetAttributes() throws JellyTagException {
        // create a new dynabean before the attributes are set
        try {
            bean = beanClass.newInstance();
            setDynaBean( new ConvertingWrapDynaBean( bean ) );
        } catch (InstantiationException e) {
            throw new JellyTagException("Could not instantiate dynabean",e);
        } catch (IllegalAccessException e) {
            throw new JellyTagException("Could not instantiate dynabean",e);
        }
View Full Code Here

                    dynaTag.setAttribute(name, value);
                }
            }
            else {
                // treat the tag as a bean
                DynaBean dynaBean = new ConvertingWrapDynaBean( tag );
                for (Iterator iter = attributes.entrySet().iterator(); iter.hasNext();) {
                    Map.Entry entry = (Map.Entry) iter.next();
                    String name = (String) entry.getKey();
                    Expression expression = (Expression) entry.getValue();

                    DynaProperty property = dynaBean.getDynaClass().getDynaProperty(name);
                    if (property == null) {
                        throw new JellyException("This tag does not understand the '" + name + "' attribute" );
                    }
                    Class type = property.getType();

                    Object value = null;
                    if (type.isAssignableFrom(Expression.class) && !type.isAssignableFrom(Object.class)) {
                        value = expression;
                    }
                    else {
                        value = expression.evaluateRecurse(context);
                    }
                    dynaBean.set(name, value);
                }
            }

            tag.doTag(output);
            output.flush();
View Full Code Here

    public void beforeSetAttributes() throws JellyTagException {
        // create a new dynabean before the attributes are set
        try {
            bean = beanClass.newInstance();
            setDynaBean( new ConvertingWrapDynaBean( bean ) );
        } catch (InstantiationException e) {
            throw new JellyTagException("Could not instantiate dynabean",e);
        } catch (IllegalAccessException e) {
            throw new JellyTagException("Could not instantiate dynabean",e);
        }
View Full Code Here

                    dynaTag.setAttribute(name, value);
                }
            }
            else {
                // treat the tag as a bean
                DynaBean dynaBean = new ConvertingWrapDynaBean( tag );
                for (Iterator iter = attributes.entrySet().iterator(); iter.hasNext();) {
                    Map.Entry entry = (Map.Entry) iter.next();
                    String name = (String) entry.getKey();
                    Expression expression = (Expression) entry.getValue();

                    DynaProperty property = dynaBean.getDynaClass().getDynaProperty(name);
                    if (property == null) {
                        throw new JellyException("This tag does not understand the '" + name + "' attribute" );
                    }
                    Class type = property.getType();

                    Object value = null;
                    if (type.isAssignableFrom(Expression.class) && !type.isAssignableFrom(Object.class)) {
                        value = expression;
                    }
                    else {
                        value = expression.evaluateRecurse(context);
                    }
                    dynaBean.set(name, value);
                }
            }

            tag.doTag(output);
            if (output != null) {
View Full Code Here

    }

    public void beforeSetAttributes() throws Exception {
        // create a new dynabean before the attributes are set
        bean = beanClass.newInstance();
        setDynaBean( new ConvertingWrapDynaBean( bean ) );

        setAttributesSet.clear();                   
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.beanutils.ConvertingWrapDynaBean

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.