public static String displayType(String className, Object value) {
		if (className == null) {
			return null;
		}
		boolean array = false;
		if (className.equals("[J")) {
			array = true;
			if (value == null) {
				className = "unknown";
			} else if (value instanceof boolean[]) {
				className = "boolean";
			} else if (value instanceof byte[]) {
				className = "byte";
			} else if (value instanceof char[]) {
				className = "char";
			} else if (value instanceof short[]) {
				className = "short";
			} else if (value instanceof int[]) {
				className = "int";
			} else if (value instanceof long[]) {
				className = "long";
			} else if (value instanceof float[]) {
				className = "float";
			} else if (value instanceof double[]) {
				className = "double";
			} else {
				className = "unknown";
			}
		} else if (className.startsWith("[L")) {
			className = className.substring(2, className.length() - 1);
		}
		if (className.startsWith("java.lang.")) {
			className = className.substring(10);
		} else if (className.startsWith("javax.management.openmbean.")) {
			className = className.substring(27);
		}
		if (array) {
			return "array of " + className;
		} else {
			return className;
		}
	}
public static String displayType ( String className , Object value ) { if ( className == null ) { return null ; } boolean array = false ; if ( className . equals ( "[J" ) ) { array = true ; if ( value == null ) { className = "unknown" ; } else if ( value instanceof boolean [ ] ) { className = "boolean" ; } else if ( value instanceof byte [ ] ) { className = "byte" ; } else if ( value instanceof char [ ] ) { className = "char" ; } else if ( value instanceof short [ ] ) { className = "short" ; } else if ( value instanceof int [ ] ) { className = "int" ; } else if ( value instanceof long [ ] ) { className = "long" ; } else if ( value instanceof float [ ] ) { className = "float" ; } else if ( value instanceof double [ ] ) { className = "double" ; } else { className = "unknown" ; } } else if ( className . startsWith ( "[L" ) ) { className = className . substring ( 2 , className . length ( ) - 1 ) ; } if ( className . startsWith ( "java.lang." ) ) { className = className . substring ( 10 ) ; } else if ( className . startsWith ( "javax.management.openmbean." ) ) { className = className . substring ( 27 ) ; } if ( array ) { return "array of " + className ; } else { return className ; } }
Display type string from class name string.