java.lang.Object | |
↳ | com.sun.jmx.mbeanserver.OpenConverter |
A converter between Java types and the limited set of classes defined by Open MBeans.
A Java type is an instance of java.lang.reflect.Type. For our
purposes, it is either a Class, such as String.class or int.class;
or a ParameterizedType, such as List
Each Type is associated with an OpenConverter. The OpenConverter defines an OpenType corresponding to the Type, plus a Java class corresponding to the OpenType. For example:
Type Open class OpenType ---- ---------- -------- Integer Integer SimpleType.INTEGER int int SimpleType.INTEGER Integer[] Integer[] ArrayType(1, SimpleType.INTEGER) int[] Integer[] ArrayType(SimpleType.INTEGER, true) String[][] String[][] ArrayType(2, SimpleType.STRING) ListString[] ArrayType(1, SimpleType.STRING) ThreadState (an Enum) String SimpleType.STRING Map TabularData TabularType( CompositeType( {"key", SimpleType.INTEGER}, {"value", ArrayType(1, SimpleType.STRING)}), indexNames={"key"})
Apart from simple types, arrays, and collections, Java types are converted through introspection into CompositeType. The Java type must have at least one getter (method such as "int getSize()" or "boolean isBig()"), and we must be able to deduce how to reconstruct an instance of the Java class from the values of the getters using one of various heuristics.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Utility method to take a string and convert it to normal Java variable
name capitalization.
| |||||||||||
Convert an instance of openClass into an instance of targetType. | |||||||||||
Get the converter for the given Java type, creating it if necessary.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Utility method to take a string and convert it to normal Java variable name capitalization. This normally means converting the first character from upper case to lower case, but in the (unusual) special case when there is more than one character and both the first and second characters are upper case, we leave it alone.
Thus "FooBah" becomes "fooBah" and "X" becomes "x", but "URL" stays as "URL".
name | The string to be decapitalized. |
---|
Convert an instance of openClass into an instance of targetType.
InvalidObjectException |
---|
Get the converter for the given Java type, creating it if necessary.
OpenDataException |
---|