Java Utililty Methods Array Type Get

List of utility methods to do Array Type Get

Description

The list of methods to do Array Type Get are organized into topic(s).

Method

ClassarrayBaseClass(Class c)
Gets the base component type of an array of arbitrary dimensions.
Class<?> result = c;
while (result.isArray()) {
    result = result.getComponentType();
return result;
ClassarrayClass(Class klass)
array Class
Class<A[]> result;
try {
    result = (Class<A[]>) Class.forName("[" + klass.getName());
} catch (Exception e) {
    throw new RuntimeException(e);
return result;
ClassarrayClass(Class compClass)
Return the array class that holds the specific component type.
ClassLoader loader = compClass.getClassLoader();
if (loader == null) {
    loader = Thread.currentThread().getContextClassLoader();
if (loader == null) {
    loader = ClassLoader.getSystemClassLoader();
if (loader == null) {
...
ClassarrayComponentClassFromArray(T[] arg)
Helper method to create an arrayComponentType from the componentType of an array that's provided.
return (Class<T>) arg.getClass().getComponentType();
booleanarrayElementIsObjectType(Class clazz)
array Element Is Object Type
return isArray(clazz) && !isBasicClass(clazz.getComponentType());