org.apache.jorphan.reflect

## Class ClassTools

- java.lang.Object
- - org.apache.jorphan.reflect.ClassTools

-     public class ClassTools
      extends java.lang.Object

  Utility methods for handling dynamic access to classes.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClassTools()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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 java.lang.Object` | `construct(java.lang.String className, java.lang.String parameter)` Call a class constructor with an String 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` - name of the class to be constructed
      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` - name of the class to be constructed
        `parameter` - the value to be used in the constructor
      Returns:
        an instance of the class
      Throws:
        `JMeterException` - if class cannot be created

    - #### construct

          public static java.lang.Object construct(java.lang.String className,
                                                   java.lang.String parameter)
                                            throws JMeterException

      Call a class constructor with an String parameter
      Parameters:
        `className` - the name of the class to construct
        `parameter` - to be used for the construction of the class instance
      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` - object on which the method should be called
        `methodName` - name of the method to be called
      Throws:
        `java.lang.SecurityException` - if a security violation occurred while looking for the method
        `java.lang.IllegalArgumentException` - if the method parameters (none given) do not match the signature of the method
        `JMeterException` - if something went wrong in the invoked method

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