Package org.csstudio.ui.util
Class ReflectUtil
java.lang.Object
org.csstudio.ui.util.ReflectUtil
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getComponentType
(String targetClass) Analogous to Class.getComponentType().static boolean
Analogous to Class.isArray().static boolean
isInstance
(Object obj, String targetClass) Analogous to Class.isInstance(Object obj).static String
toArrayClass
(String className) Returns the array class name for the given class name.
-
Constructor Details
-
ReflectUtil
public ReflectUtil()
-
-
Method Details
-
isInstance
Analogous to Class.isInstance(Object obj). -
isArray
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
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
Returns the array class name for the given class name.- Parameters:
className
- a class name- Returns:
- the corresponding array class
-