public GetMethod ( |
||
c | Class in which the method search is taking place | |
name | String | Name of the method being searched for |
parameters | Object | An array of Objects (not Classes) that describe the the parameters |
Résultat |
public void Test_Evaluate() { IRuntimeServices rs = RuntimeSingleton.RuntimeServices; Introspector i = new Introspector(rs); MethodInfo mi = i.GetMethod(typeof(VelocityTest), "Test_Evaluate", null); Assert.IsNotNull(mi, "Expected to find VelocityTest.Test_Evaluate"); Assert.IsTrue(mi.ToString().Equals("Void Test_Evaluate()"), "method not found"); mi = i.GetMethod(typeof(ExtendedProperties), "GetString", new Object[] {"parm1", "parm2"}); Assert.IsNotNull(mi, "Expected to find ExtendedProperties.GetString(String, String)"); Assert.IsTrue(mi.ToString().Equals("System.String GetString(System.String, System.String)"), "method not found"); }
/// <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); } } }