Apache JMeter

org.apache.jorphan.reflect
Class ClassTools

java.lang.Object
  extended by org.apache.jorphan.reflect.ClassTools

public class ClassTools
extends java.lang.Object

Utility methods for handling dynamic access to classes.


Constructor Summary
ClassTools()
           
 
Method Summary
static java.lang.Object construct(java.lang.String className)
          Call no-args constructor for a class.
static java.lang.Object construct(java.lang.String className, int parameter)
          Call a class constructor with an integer parameter
static void invoke(java.lang.Object instance, java.lang.String methodName)
          Invoke a public method on a class instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassTools

public ClassTools()
Method Detail

construct

public static java.lang.Object construct(java.lang.String className)
                                  throws JMeterException
Call no-args constructor for a class.

Parameters:
className -
Returns:
an instance of the class
Throws:
JMeterException - if class cannot be created

construct

public static java.lang.Object construct(java.lang.String className,
                                         int parameter)
                                  throws JMeterException
Call a class constructor with an integer parameter

Parameters:
className -
parameter - (integer)
Returns:
an instance of the class
Throws:
JMeterException - if class cannot be created

invoke

public static void invoke(java.lang.Object instance,
                          java.lang.String methodName)
                   throws java.lang.SecurityException,
                          java.lang.IllegalArgumentException,
                          JMeterException
Invoke a public method on a class instance

Parameters:
instance -
methodName -
Throws:
java.lang.SecurityException
java.lang.IllegalArgumentException
JMeterException

Apache JMeter

Copyright © 1998-2009 Apache Software Foundation. All Rights Reserved.