Package org.apache.velocity.util.introspection

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


    {
        Method verifyMethod = TestInterface.class.getMethod("getTestValue", new Class[0]);


        RuntimeInstance ri = new RuntimeInstance();
        Introspector introspector = ri.getIntrospector();

        Method testMethod = introspector.getMethod(TestObject.class, "getTestValue", new Object[0]);
        assertNotNull(testMethod);
        assertEquals("Method object does not match!", verifyMethod, testMethod);
    }
View Full Code Here


        vmFactory = new VelocimacroFactory( this );

        /*
         *  make a new introspector and initialize it
         */
        introspector = new Introspector(getLog());

        /*
         * and a store for the application attributes
         */
        applicationAttributes = new HashMap();
View Full Code Here

        vmFactory = new VelocimacroFactory( this );

        /*
         *  make a new introspector and initialize it
         */
        introspector = new Introspector(getLog());

        /*
         * and a store for the application attributes
         */
        applicationAttributes = new HashMap();
View Full Code Here

        vmFactory = new VelocimacroFactory( this );

        /*
         *  make a new introspector and initialize it
         */
        introspector = new Introspector(getLog());

        /*
         * and a store for the application attributes
         */
        applicationAttributes = new HashMap();
View Full Code Here

        {
            char c;
            StringBuffer sb;

            Object[] params = {  };
            Introspector introspector = rsvc.getIntrospector();
           
            /*
             *  start with get<property>
             *  this leaves the property name
             *  as is...
             */
            sb = new StringBuffer( "get" );
            sb.append( property );

            methodUsed = sb.toString();

            method = introspector.getMethod( clazz, methodUsed, params);
            
            if (method != null)
                return;
       
            /*
             *  now the convenience, flip the 1st character
             */
        
            sb = new StringBuffer( "get" );
            sb.append( property );

            c = sb.charAt(3);

            ifCharacter.isLowerCase( c ) )
            {
                sb.setCharAt( 3 ,  Character.toUpperCase( c ) );
            }
            else
            {
                sb.setCharAt( 3 ,  Character.toLowerCase( c ) );
            }

            methodUsed = sb.toString();
            method = introspector.getMethod( clazz, methodUsed, params);

            if ( method != null)
                return;
           
        }
View Full Code Here

        {
            char c;
            StringBuffer sb;

            Object[] params = {  };
            Introspector introspector = rsvc.getIntrospector();
           
            /*
             *  start with get<property>
             *  this leaves the property name
             *  as is...
             */
            sb = new StringBuffer( "get" );
            sb.append( property );

            methodUsed = sb.toString();

            method = introspector.getMethod( clazz, methodUsed, params);
            
            if (method != null)
                return;
       
            /*
             *  now the convenience, flip the 1st character
             */
        
            sb = new StringBuffer( "get" );
            sb.append( property );

            c = sb.charAt(3);

            ifCharacter.isLowerCase( c ) )
            {
                sb.setCharAt( 3 ,  Character.toUpperCase( c ) );
            }
            else
            {
                sb.setCharAt( 3 ,  Character.toLowerCase( c ) );
            }

            methodUsed = sb.toString();
            method = introspector.getMethod( clazz, methodUsed, params);

            if ( method != null)
                return;
           
        }
View Full Code Here

        {
            char c;
            StringBuffer sb;

            Object[] params = {  };
            Introspector introspector = rsvc.getIntrospector();
              
            /*
             *  now look for a boolean isFoo
             */
           
            sb = new StringBuffer( "is" );
            sb.append( property );

            c = sb.charAt(2);

            ifCharacter.isLowerCase(c) )
            {
                sb.setCharAt( 2 ,  Character.toUpperCase(c) );
            }

            methodUsed = sb.toString();
            method = introspector.getMethod( clazz, methodUsed, params);

            if (method != null)
            {
                /*
                 *  now, this has to return a boolean
View Full Code Here

        {
            char c;
            StringBuffer sb;

            Object[] params = {  };
            Introspector introspector = rsvc.getIntrospector();
              
            /*
             *  now look for a boolean isFoo
             */
           
            sb = new StringBuffer( "is" );
            sb.append( property );

            c = sb.charAt(2);

            ifCharacter.isLowerCase(c) )
            {
                sb.setCharAt( 2 ,  Character.toUpperCase(c) );
            }

            methodUsed = sb.toString();
            method = introspector.getMethod( clazz, methodUsed, params);

            if (method != null)
            {
                /*
                 *  now, this has to return a boolean
View Full Code Here

        /*
         *  make a new introspector and initialize it
         */
        
        introspector = new Introspector( this );

        /*
         * and a store for the application attributes
         */

 
View Full Code Here

    {
  Method verifyMethod = TestInterface.class.getMethod("getTestValue", new Class[0]);
 
 
  RuntimeInstance ri = new RuntimeInstance();
  Introspector introspector = ri.getIntrospector();
 
  Method testMethod = introspector.getMethod(TestObject.class, "getTestValue", new Object[0]);
  assertNotNull(testMethod);
  assertEquals("Method object does not match!", verifyMethod, testMethod);
    }
View Full Code Here

TOP

Related Classes of org.apache.velocity.util.introspection.Introspector

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.