Class ReflectUtil

java.lang.Object
org.csstudio.ui.util.ReflectUtil

public class ReflectUtil extends Object
Implementing some introspection functions based on the class name instead of the class object. Using class tokens would mean that this plugin has dependencies to all plugins that have a single type.
  • Constructor Details

    • ReflectUtil

      public ReflectUtil()
  • Method Details

    • isInstance

      public static boolean isInstance(Object obj, String targetClass)
      Analogous to Class.isInstance(Object obj).
    • isArray

      public static boolean isArray(String targetClass)
      Analogous to Class.isArray(). True if the class is an array
      Parameters:
      targetClass - a class name
      Returns:
      true if class name represents an array
    • getComponentType

      public static String getComponentType(String targetClass)
      Analogous to Class.getComponentType(). Return the type of the elements of the array.
      Parameters:
      targetClass - a class representing an array
      Returns:
      the class of the array
    • toArrayClass

      public static String toArrayClass(String className)
      Returns the array class name for the given class name.
      Parameters:
      className - a class name
      Returns:
      the corresponding array class