public class

Utils

extends Object
java.lang.Object
   ↳ sun.tools.jconsole.inspector.Utils

Summary

Nested Classes
class Utils.CopyKeyAdapter  
class Utils.EditFocusAdapter  
class Utils.ReadOnlyTableCellEditor  
Public Methods
static boolean canBeRenderedAsArray(Object elem)
Check if the given element denotes a supported array-friendly data structure, i.e.
static Object createObjectFromString(String type, String value)
This method attempts to create an object of the given "type" using the "value" parameter.
static Throwable getActualException(Throwable e)
If the exception is wrapped, unwrap it.
static String getArrayClassName(String name)
This method provides a readable classname if it's an array, i.e.
static Class<?> getClass(String className)
This method returns the class matching the name className.
static String getDefaultValue(String type)
This method inserts a default value for the standard java types, else it inserts the text name of the expected class type.
static Object[] getParameters(XTextField[] inputs, String[] params)
This method is responsible for converting the inputs given by the user into a useful object array for passing into a parameter array.
static String getReadableClassName(String name)
This methods provides a readable classname.
static boolean isEditableType(String type)
This method tells whether the type is editable (means can be created with a String or not)
static boolean isSupportedArray(Object elem)
Check if the given element is an array.
static boolean isUniformCollection(Collection<?> c, Class<?> e)
Check if the given collection is a uniform collection of the given type.
static Object newStringConstructor(String type, String param)
Try to create a Java object using a one-string-param constructor.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static boolean canBeRenderedAsArray (Object elem)

Check if the given element denotes a supported array-friendly data structure, i.e. a data structure jconsole can render as an array.

public static Object createObjectFromString (String type, String value)

This method attempts to create an object of the given "type" using the "value" parameter. e.g. calling createObjectFromString("java.lang.Integer", "10") will return an Integer object initialized to 10.

Throws
Exception

public static Throwable getActualException (Throwable e)

If the exception is wrapped, unwrap it.

public static String getArrayClassName (String name)

This method provides a readable classname if it's an array, i.e. either the classname of the component type for arrays of java reference types or the name of the primitive type for arrays of java primitive types. Otherwise, it returns null.

public static Class<?> getClass (String className)

This method returns the class matching the name className. It's used to cater for the primitive types.

public static String getDefaultValue (String type)

This method inserts a default value for the standard java types, else it inserts the text name of the expected class type. It acts to give a clue as to the input type.

public static Object[] getParameters (XTextField[] inputs, String[] params)

This method is responsible for converting the inputs given by the user into a useful object array for passing into a parameter array.

Throws
Exception

public static String getReadableClassName (String name)

This methods provides a readable classname. If the supplied name parameter denotes an array this method returns either the classname of the component type for arrays of java reference types or the name of the primitive type for arrays of java primitive types followed by n-times "[]" where 'n' denotes the arity of the array. Otherwise, if the supplied name doesn't denote an array it returns the same classname.

public static boolean isEditableType (String type)

This method tells whether the type is editable (means can be created with a String or not)

public static boolean isSupportedArray (Object elem)

Check if the given element is an array. Multidimensional arrays are not supported. Non-empty 1-dimensional arrays of CompositeData and TabularData are not handled as arrays but as tabular data.

public static boolean isUniformCollection (Collection<?> c, Class<?> e)

Check if the given collection is a uniform collection of the given type.

public static Object newStringConstructor (String type, String param)

Try to create a Java object using a one-string-param constructor.

Throws
Exception