This basic function of this class is to return a Method object for a particular class given the name of a method and the parameters to the method in the form of an Object[] The first time the Introspector sees a class it creates a class method map for the class in question. Basically the class method map is a Hastable where Method objects are keyed by a concatenation of the method name and the names of classes that make up the parameters. For example, a method with the following signature: public void method(String a, StringBuffer b) would be mapped by the key: "method" + "java.lang.String" + "java.lang.StringBuffer" This mapping is performed for all the methods in a class and stored for
Inheritance: IntrospectorBase
        public EnumValueExecutor(IRuntimeLogger r, Introspector i, Type type, String propertyName)
        {
            runtimeLogger = r;
            introspector = i;

            Discover(type, propertyName);
        }
Ejemplo n.º 2
0
        public void Test_Evaluate()
        {
            RuntimeServices rs = RuntimeSingleton.RuntimeServices;
            Introspector i = new Introspector(rs);
            MethodInfo mi = i.getMethod(typeof(VelocityTest), "Test_Evaluate", null);
            Assertion.AssertNotNull("Expected to find VelocityTest.Test_Evaluate", mi);
            Assertion.Assert("method not found", mi.ToString().Equals("Void Test_Evaluate()"));

            mi = i.getMethod(typeof(ExtendedProperties), "GetString", new Object[] { "parm1", "parm2" });
            Assertion.AssertNotNull("Expected to find ExtendedProperties.GetString(String, String)", mi);
            Assertion.Assert("method not found", mi.ToString().Equals("System.String GetString(System.String, System.String)"));
        }
Ejemplo n.º 3
0
		/// <summary>
		/// Default constructor.
		/// </summary>
		public GetExecutor(IRuntimeLogger r, Introspector i, Type c, String key)
		{
			runtimeLogger = r;
			arguments[0] = key;

			// NOTE: changed from get to get to get_Item - assumption is that get would be converted to an indexer in .Net
			// to keep some resemblance to the Java version, look for "Get" and "get" methods as well (both cases for .Net style and java)
			method = i.GetMethod(c, "get_Item", arguments);
			if (method == null)
			{
				method = i.GetMethod(c, "Get", arguments);
				if (method == null)
				{
					method = i.GetMethod(c, "get", arguments);
				}
			}
		}
Ejemplo n.º 4
0
		public RuntimeInstance()
		{
			// logSystem = new PrimordialLogSystem();
			configuration = new ExtendedProperties();

			// create a VM factory, resource manager
			// and introspector
			vmFactory = new VelocimacroFactory(this);

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

			// and a store for the application attributes
			applicationAttributes = new Hashtable();
		}
		public BooleanPropertyExecutor(IRuntimeLogger r, Introspector i, Type type, String propertyName)
			: base(r, i, type, propertyName)
		{
		}