Package org.apache.flex.forks.velocity.util.introspection

Examples of org.apache.flex.forks.velocity.util.introspection.IntrospectionCacheData


        {
            /*
             *   check the cache
             */

            IntrospectionCacheData icd =  context.icacheGet( this );
            Class c = o.getClass();

            /*
             *  like ASTIdentifier, if we have cache information, and the
             *  Class of Object o is the same as that in the cache, we are
             *  safe.
             */

            if ( icd != null && icd.contextData == c )
            {
                /*
                 * sadly, we do need recalc the values of the args, as this can
                 * change from visit to visit
                 */

                for (int j = 0; j < paramCount; j++)
                    params[j] = jjtGetChild(j + 1).value(context);

                /*
                 * and get the method from the cache
                 */

                method = (VelMethod) icd.thingy;
            }
            else
            {
                /*
                 *  otherwise, do the introspection, and then
                 *  cache it
                 */

                for (int j = 0; j < paramCount; j++)
                    params[j] = jjtGetChild(j + 1).value(context);

                method = rsvc.getUberspect().getMethod(o, methodName, params, new Info("",1,1));

                if (method != null)
                {   
                    icd = new IntrospectionCacheData();
                    icd.contextData = c;
                    icd.thingy = method;
                    context.icachePut( this, icd );
                }
            }
View Full Code Here


            /*
             *  first, see if we have this information cached.
             */

            IntrospectionCacheData icd = context.icacheGet(this);

            /*
             * if we have the cache data and the class of the object we are
             * invoked with is the same as that in the cache, then we must
             * be allright.  The last 'variable' is the method name, and
             * that is fixed in the template :)
             */

            if (icd != null && icd.contextData == c)
            {
                vg = (VelPropertyGet) icd.thingy;
            }
            else
            {
                /*
                 *  otherwise, do the introspection, and cache it.  Use the
                 *  uberspector
                 */

                vg = rsvc.getUberspect().getPropertyGet(o,identifier, uberInfo);

                if (vg != null && vg.isCacheable())
                {
                    icd = new IntrospectionCacheData();
                    icd.contextData = c;
                    icd.thingy = vg;
                    context.icachePut(this,icd);
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.flex.forks.velocity.util.introspection.IntrospectionCacheData

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.