Examples of VelPropertySet


Examples of org.apache.velocity.util.introspection.VelPropertySet

    }

    public void testMultipleParameterTypes()
            throws Exception
    {
        VelPropertySet setter;

        Uberspect u = ri.getUberspect();
        UberspectorTestObject uto = new UberspectorTestObject();

        // setAmbigous() - String
        setter = u.getPropertySet(uto, "Ambigous", "", null);
        assertNotNull(setter);
        assertEquals("Found wrong method", "setAmbigous", setter.getMethodName());

        // setAmbigous() - StringBuffer
        setter = u.getPropertySet(uto, "Ambigous", new StringBuffer(), null);
        assertNotNull(setter);
        assertEquals("Found wrong method", "setAmbigous", setter.getMethodName());
    }
View Full Code Here

Examples of org.apache.velocity.util.introspection.VelPropertySet


    public void testRegularSetters()
            throws Exception
    {
        VelPropertySet setter;

        Uberspect u = ri.getUberspect();
        UberspectorTestObject uto = new UberspectorTestObject();

        // setRegular()
        setter = u.getPropertySet(uto, "Regular", "", null);
        assertNotNull(setter);
        assertEquals("Found wrong method", "setRegular", setter.getMethodName());

        // Lowercase regular
        setter = u.getPropertySet(uto, "regular", "", null);
        assertNotNull(setter);
        assertEquals("Found wrong method", "setRegular", setter.getMethodName());

        // lowercase: setpremium()
        setter = u.getPropertySet(uto, "premium", "", null);
        assertNotNull(setter);
        assertEquals("Found wrong method", "setpremium", setter.getMethodName());

        // test uppercase: getpremium()
        setter = u.getPropertySet(uto, "Premium", "", null);
        assertNotNull(setter);
        assertEquals("Found wrong method", "setpremium", setter.getMethodName());
    }
View Full Code Here

Examples of org.apache.velocity.util.introspection.VelPropertySet

     */
    public VelPropertySet getPropertySet(Object obj, String identifier,
                                         Object arg, Info i)
            throws Exception
    {
        VelPropertySet ret = super.getPropertySet(obj,identifier,arg,i);
        if(ret == null) {
            Class claz = obj.getClass();
            if(obj instanceof HttpServletRequest
                || obj instanceof HttpSession
                || obj instanceof ServletContext)
View Full Code Here

Examples of org.apache.velocity.util.introspection.VelPropertySet

         2) ref,put("foo", value ) to parallel the get() map introspection
         */

        try
        {
            VelPropertySet vs =
                    rsvc.getUberspect().getPropertySet(result, identifier,
                            value, uberInfo);

            if (vs == null)
                return false;

            vs.invoke(result, value);
        }
        catch(InvocationTargetException ite)
        {
            /*
             *  this is possible
View Full Code Here

Examples of org.apache.velocity.util.introspection.VelPropertySet

    }

    public VelPropertySet getPropertySet(Object obj, String identifier,
                                         Object arg, Info i) throws Exception
    {
      VelPropertySet setter = super.getPropertySet(obj, identifier, arg, i);
      if (setter == null)
      {
        ThreadLocalToolkit.log(new SetMethodNotFound(i.getTemplateName(), i.getLine(), i.getColumn(), identifier, obj.getClass().getName()));
      }
View Full Code Here

Examples of org.apache.velocity.util.introspection.VelPropertySet

         2) ref,put("foo", value ) to parallel the get() map introspection
         */

        try
        {
            VelPropertySet vs =
                    rsvc.getUberspect().getPropertySet(result, identifier,
                            value, uberInfo);

            if (vs == null)
                return false;

            vs.invoke(result, value);
        }
        catch(InvocationTargetException ite)
        {
            /*
             *  this is possible
View Full Code Here

Examples of org.apache.velocity.util.introspection.VelPropertySet

         2) ref,put("foo", value ) to parallel the get() map introspection
         */

        try
        {
            VelPropertySet vs =
                    rsvc.getUberspect().getPropertySet(result, identifier,
                            value, uberInfo);

            if (vs == null)
            {
                if (strictRef)
                {
                    throw new MethodInvocationException("Object '" + result.getClass().getName() +
                       "' does not contain property '" + identifier + "'", null, identifier,
                       uberInfo.getTemplateName(), uberInfo.getLine(), uberInfo.getColumn());
                }
                else
                {
                  return false;
                }
            }

            vs.invoke(result, value);
        }
        catch(InvocationTargetException ite)
        {
            /*
             *  this is possible
View Full Code Here

Examples of org.apache.velocity.util.introspection.VelPropertySet

         2) ref,put("foo", value ) to parallel the get() map introspection
         */

        try
        {
            VelPropertySet vs =
                    rsvc.getUberspect().getPropertySet(result, identifier,
                            value, uberInfo);

            if (vs == null)
                return false;

            vs.invoke(result, value);
        }
        catch(InvocationTargetException ite)
        {
            /*
             *  this is possible
View Full Code Here

Examples of org.apache.velocity.util.introspection.VelPropertySet

         2) ref,put("foo", value ) to parallel the get() map introspection
         */

        try
        {
            VelPropertySet vs =
                    rsvc.getUberspect().getPropertySet(result, identifier,
                            value, uberInfo);

            if (vs == null)
            {
                if (strictRef)
                {
                    throw new MethodInvocationException("Object '" + result.getClass().getName() +
                       "' does not contain property '" + identifier + "'", null, identifier,
                       uberInfo.getTemplateName(), uberInfo.getLine(), uberInfo.getColumn());
                }
                else
                {
                  return false;
                }
            }

            vs.invoke(result, value);
        }
        catch(InvocationTargetException ite)
        {
            /*
             *  this is possible
View Full Code Here

Examples of org.apache.velocity.util.introspection.VelPropertySet

         */

        try
        {
            RuntimeServices rsvc=VelocityUtil.getEngine().getRuntimeServices();
            VelPropertySet vs =
                    rsvc.getUberspect().getPropertySet(result, identifier,
                            value, uberInfo);

            if (vs == null)
            {
                if (strictRef)
                {
                    throw new MethodInvocationException("Object '" + result.getClass().getName() +
                       "' does not contain property '" + identifier + "'", null, identifier,
                       uberInfo.getTemplateName(), uberInfo.getLine(), uberInfo.getColumn());
                }
                else
                {
                  return false;
                }
            }

            vs.invoke(result, value);
        }
        catch(InvocationTargetException ite)
        {
            /*
             *  this is possible
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.