Examples of VelPropertySet


Examples of org.apache.flex.forks.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.flex.forks.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)
            {
                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)
            {
                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)
            {
                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

        Uberspect u = ri.getUberspect();

        VelPropertyGet getter = u.getPropertyGet(null, "foo", null);
        assertNull(getter);

        VelPropertySet setter = u.getPropertySet(null, "foo", Object.class, null);
        assertNull(setter);
    }
View Full Code Here

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

            throws Exception
    {
        Uberspect u = ri.getUberspect();
        Map map = new HashMap();

        VelPropertySet setter = u.getPropertySet(map, "", Object.class, null);

        // Don't screw up on empty properties. That should map to put("", Object)
        assertNotNull(setter);
        assertEquals("Found wrong method", "put", setter.getMethodName());
    }
View Full Code Here

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

        Uberspect u = ri.getUberspect();
        GetPutObject gpo = new GetPutObject();
        Map map = new HashMap();

        // Don't screw up on null properties. That should map to put() on the GPO.
        VelPropertySet setter = u.getPropertySet(gpo, null, "", null);
        assertNotNull(setter);
        assertEquals("Found wrong method", "put", setter.getMethodName());

        // And should be null on a Map which does not have a put()
        setter = u.getPropertySet(map, null, "", null);
        assertNull(setter);
    }
View Full Code Here

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

    }

    public void testNullParameterType()
            throws Exception
    {
        VelPropertySet setter;

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

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

        // setAmbigous() - String and StringBuffer available
        setter = u.getPropertySet(uto, "Ambigous", null, null);
        assertNull(setter);
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.