You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by ge...@apache.org on 2001/09/09 23:50:33 UTC
cvs commit: jakarta-velocity/src/java/org/apache/velocity/util/introspection Introspector.java
geirm 01/09/09 14:50:33
Modified: src/java/org/apache/velocity/util/introspection
Introspector.java
Log:
Final bit of change for seperable runtime instances, also brings
introspection into the instance (as all other resources are...)
Revision Changes Path
1.10 +12 -6 jakarta-velocity/src/java/org/apache/velocity/util/introspection/Introspector.java
Index: Introspector.java
===================================================================
RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/util/introspection/Introspector.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Introspector.java 2001/03/05 11:48:49 1.9
+++ Introspector.java 2001/09/09 21:50:33 1.10
@@ -59,7 +59,7 @@
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
-import org.apache.velocity.util.StringUtils;
+import org.apache.velocity.runtime.RuntimeServices;
/**
* This basic function of this class is to return a Method
@@ -85,15 +85,21 @@
* and stored for
* @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
* @author <a href="mailto:bob@werken.com">Bob McWhirter</a>
- * @version $Id: Introspector.java,v 1.9 2001/03/05 11:48:49 jvanzyl Exp $
+ * @version $Id: Introspector.java,v 1.10 2001/09/09 21:50:33 geirm Exp $
*/
public class Introspector
{
private static Hashtable classMethodMaps = new Hashtable();
+ private RuntimeServices rsvc = null;
- public static Method getMethod(Class c, String name, Object[] params)
- throws Exception
+ public void init( RuntimeServices r )
{
+ this.rsvc = r;
+ }
+
+ public Method getMethod(Class c, String name, Object[] params)
+ throws Exception
+ {
if (c == null)
{
throw new Exception (
@@ -140,7 +146,7 @@
* @param String name of method
* @param Object[] parameters
*/
- private static Method findMethod(Class c, String name, Object[] params)
+ private Method findMethod(Class c, String name, Object[] params)
{
ClassMap classMethodMap = (ClassMap) classMethodMaps.get(c);
return classMethodMap.findMethod(name, params);
@@ -154,7 +160,7 @@
* @param methodName The method to check for.
* @return Whether the method is implemented.
*/
- public static boolean implementsMethod(Object object, String methodName)
+ public boolean implementsMethod(Object object, String methodName)
{
int m;