org.crosswire.common.util
Class ReflectionUtil

java.lang.Object
  extended by org.crosswire.common.util.ReflectionUtil

public class ReflectionUtil
extends Object

Various utilities for running introspected methods.

Distribution Licence:
JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
The copyright to this program is held by it's authors.

Version:
$Id: ReflectionUtil.java,v 1.4 2005/03/19 18:45:07 dmsmith Exp $
Author:
Joe Walker [joe at eireneh dot com]
See Also:
Licence

Constructor Summary
private ReflectionUtil()
          Prevent Instansiation
 
Method Summary
static Object invoke(Object base, String methodName, Object[] params)
          Call a method on a class given a sting
static Object invoke(String call, Object[] params)
          Call a static method on a class given a sting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionUtil

private ReflectionUtil()
Prevent Instansiation

Method Detail

invoke

public static Object invoke(Object base,
                            String methodName,
                            Object[] params)
                     throws NoSuchMethodException,
                            IllegalAccessException,
                            InvocationTargetException
Call a method on a class given a sting

Parameters:
base - The object to invoke a method on
methodName - The text of the invocation eg "getName"
params - For example new Object[] { ...}
Throws:
NoSuchMethodException
IllegalAccessException
InvocationTargetException

invoke

public static Object invoke(String call,
                            Object[] params)
                     throws ClassNotFoundException,
                            NoSuchMethodException,
                            IllegalAccessException,
                            InvocationTargetException
Call a static method on a class given a sting

Parameters:
call - The text of the invocation eg "java.lang.String.getName"
params - For example new Object[] { ...}
Throws:
ClassNotFoundException
NoSuchMethodException
IllegalAccessException
InvocationTargetException

Copyright ? 2003-2004