Package org.apache.commons.jelly

Examples of org.apache.commons.jelly.DynaTag


            if ( tag == null ) {
                return;
            }
            tag.setContext(context);
           
            DynaTag dynaTag = (DynaTag) tag;
   
            // ### probably compiling this to 2 arrays might be quicker and smaller
            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);
                dynaTag.setAttribute(name, value);
            }
       
            tag.doTag(output);
        }
        catch (JellyException e) {
View Full Code Here


                return;
            }
            tag.setContext(context);
   
            if ( tag instanceof DynaTag ) {       
                DynaTag dynaTag = (DynaTag) tag;
       
                // ### probably compiling this to 2 arrays might be quicker and smaller
                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);
                    dynaTag.setAttribute(name, value);
                }
            }
            else {
                // treat the tag as a bean
                DynaBean dynaBean = new ConvertingWrapDynaBean( tag );
View Full Code Here

            if ( tag == null ) {
                return;
            }
            tag.setContext(context);

            DynaTag dynaTag = (DynaTag) tag;

            // ### probably compiling this to 2 arrays might be quicker and smaller
            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 = null;

                if ( Expression.class.isAssignableFrom( dynaTag.getAttributeType(name) ) ) {
                    value = expression;
                } else {
                    value = expression.evaluate(context);
                }

                dynaTag.setAttribute(name, value);
            }

            tag.doTag(output);
        }
        catch (JellyTagException e) {
View Full Code Here

                return;
            }
            tag.setContext(context);

            if ( tag instanceof DynaTag ) {
                DynaTag dynaTag = (DynaTag) tag;

                // ### probably compiling this to 2 arrays might be quicker and smaller
                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();

                    Class type = dynaTag.getAttributeType(name);
                    Object value = null;
                    if (type != null && type.isAssignableFrom(Expression.class) && !type.isAssignableFrom(Object.class)) {
                        value = expression;
                    }
                    else {
                        value = expression.evaluateRecurse(context);
                    }
                    dynaTag.setAttribute(name, value);
                }
            }
            else {
                // treat the tag as a bean
                DynaBean dynaBean = new ConvertingWrapDynaBean( tag );
View Full Code Here

                return;
            }
            tag.setContext(context);
            setContextURLs(context);

            DynaTag dynaTag = (DynaTag) tag;

            // ### probably compiling this to 2 arrays might be quicker and smaller
            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 = null;

                if ( Expression.class.isAssignableFrom( dynaTag.getAttributeType(name) ) ) {
                    value = expression;
                } else {
                    value = expression.evaluate(context);
                }

                dynaTag.setAttribute(name, value);
            }

            tag.doTag(output);
        }
        catch (JellyTagException e) {
View Full Code Here

            }
            tag.setContext(context);
            setContextURLs(context);

            if ( tag instanceof DynaTag ) {
                DynaTag dynaTag = (DynaTag) tag;

                // ### probably compiling this to 2 arrays might be quicker and smaller
                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();

                    Class type = dynaTag.getAttributeType(name);
                    Object value = null;
                    if (type != null && type.isAssignableFrom(Expression.class) && !type.isAssignableFrom(Object.class)) {
                        value = expression;
                    }
                    else {
                        value = expression.evaluateRecurse(context);
                    }
                    dynaTag.setAttribute(name, value);
                }
            }
            else {
                // treat the tag as a bean
                DynaBean dynaBean = new ConvertingWrapDynaBean( tag );
View Full Code Here

            }
            tag.setContext(context);
            setContextURLs(context);

            if ( tag instanceof DynaTag ) {
                DynaTag dynaTag = (DynaTag) tag;

                // ### probably compiling this to 2 arrays might be quicker and smaller
                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();

                    Class type = dynaTag.getAttributeType(name);
                    Object value = null;
                    if (type != null && type.isAssignableFrom(Expression.class) && !type.isAssignableFrom(Object.class)) {
                        value = expression;
                    }
                    else {
                        value = expression.evaluateRecurse(context);
                    }
                    dynaTag.setAttribute(name, value);
                }
            }
            else {
                // treat the tag as a bean
                DynaBean dynaBean = new ConvertingWrapDynaBean( tag );
View Full Code Here

                return;
            }
            tag.setContext(context);
            setContextURLs(context);

            DynaTag dynaTag = (DynaTag) tag;

            // ### probably compiling this to 2 arrays might be quicker and smaller
            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 = null;

                if ( Expression.class.isAssignableFrom( dynaTag.getAttributeType(name) ) ) {
                    value = expression;
                } else {
                    value = expression.evaluate(context);
                }

                dynaTag.setAttribute(name, value);
            }

            tag.doTag(output);
        }
        catch (JellyTagException e) {
View Full Code Here

            tag = findDynamicTag(context, (StaticTag) tag);
        }
        try {       
            tag.setContext(context);
           
            DynaTag dynaTag = (DynaTag) tag;
   
            // ### probably compiling this to 2 arrays might be quicker and smaller
            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);
                dynaTag.setAttribute(name, value);
            }
       
            tag.doTag(output);
        }
        catch (JellyException e) {
View Full Code Here

    /** Evaluates the body of a tag */
    public void run(JellyContext context, XMLOutput output) throws Exception {
        try {
            tag.setContext(context);
           
            DynaTag dynaTag = (DynaTag) tag;
   
            // ### probably compiling this to 2 arrays might be quicker and smaller
            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);
                dynaTag.setAttribute(name, value);
            }
       
            tag.doTag(output);
        }
        catch (JellyException e) {
View Full Code Here

TOP

Related Classes of org.apache.commons.jelly.DynaTag

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.