public class GwtReflect
extends java.lang.Object
Each method should be treated like GWT.create; you must send a Class literal, not a class reference.
Literal: SomeClass.class
Reference: Class> someClass;
Some methods will fail gracefully if you let a reference slip through. Gwt production compiles will warn you if it can generate a sub-optimal solution, (aka maps from reference to factory), but will throw an error if it cannot deliver the functionality.
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Object |
arrayGet(java.lang.Object array,
int index)
Retrieve an object from a given array using the most efficient solution for
a given platform.
|
static int |
arrayLength(java.lang.Object array)
In jvms, we defer to java.lang.reflect.Array; In Gwt, we just return the
.length property.
|
static int |
constId(java.lang.Class<?> c) |
static <T> T |
construct(java.lang.Class<? extends T> cls,
java.lang.Class<?>[] paramSignature,
java.lang.Object... params)
In gwt dev and standard jvms, this just calls
cls.getConstructor(...).newInstance(...); in gwt production, this is a
magic method which will generate calls to new T(params); Note that for Gwt
production to be fully optimized, you must always send class literals
(SomeClass.class) If you send a class reference (a Class<?> object), the
magic method injector will be forced to generate a monolithic helper class.
|
static <T extends java.lang.Throwable> |
doThrow(T exception) |
static java.lang.String |
escape(java.lang.String unescaped)
Escapes string content to be a valid string literal.
|
static <T> T |
fieldGet(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst)
Uses reflection to invoke a field getter for you; using this method will
net you convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static boolean |
fieldGetBoolean(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst)
Uses reflection to invoke a field getter for you; using this method will
net you convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static byte |
fieldGetByte(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst)
Uses reflection to invoke a field getter for you; using this method will
net you convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static char |
fieldGetChar(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst)
Uses reflection to invoke a field getter for you; using this method will
net you convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static double |
fieldGetDouble(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst)
Uses reflection to invoke a field getter for you; using this method will
net you convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static float |
fieldGetFloat(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst)
Uses reflection to invoke a field getter for you; using this method will
net you convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static int |
fieldGetInt(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst)
Uses reflection to invoke a field getter for you; using this method will
net you convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static long |
fieldGetLong(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst)
Uses reflection to invoke a field getter for you; using this method will
net you convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static void |
fieldGetLong(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst,
long value)
Uses reflection to invoke a field setter for you; using this method will
net you convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static short |
fieldGetShort(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst)
Uses reflection to invoke a field getter for you; using this method will
net you convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static void |
fieldSet(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst,
java.lang.Object value)
Uses reflection to invoke a field setter for you; using this method will
net you convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static void |
fieldSetBoolean(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst,
boolean value)
Uses reflection to invoke a field setter for you; using this method will
net you convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static void |
fieldSetByte(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst,
byte value)
Uses reflection to invoke a field setter for you; using this method will
net you convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static void |
fieldSetChar(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst,
char value)
Uses reflection to invoke a field setter for you; using this method will
net you convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static void |
fieldSetDouble(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst,
double value)
Uses reflection to invoke a field setter for you; using this method will
net you convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static void |
fieldSetFloat(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst,
float value)
Uses reflection to invoke a field setter for you; using this method will
net you convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static void |
fieldSetInt(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst,
int value)
Uses reflection to invoke a field setter for you; using this method will
net you convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static void |
fieldSetShort(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst,
short value)
Uses reflection to invoke a field setter for you; using this method will
net you convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static <T> java.lang.reflect.Constructor<T> |
getDeclaredConstructor(java.lang.Class<T> c,
java.lang.Class<?>... params) |
static <T> java.lang.reflect.Constructor<T>[] |
getDeclaredConstructors(java.lang.Class<T> c) |
static java.lang.reflect.Field |
getDeclaredField(java.lang.Class<?> c,
java.lang.String name) |
static java.lang.reflect.Field[] |
getDeclaredFields(java.lang.Class<?> c) |
static java.lang.reflect.Method |
getDeclaredMethod(java.lang.Class<?> c,
java.lang.String name,
java.lang.Class<?>... params) |
static java.lang.reflect.Method[] |
getDeclaredMethods(java.lang.Class<?> c) |
static java.lang.Package |
getPackage(java.lang.String name) |
static <T> java.lang.reflect.Constructor<T> |
getPublicConstructor(java.lang.Class<T> c,
java.lang.Class<?>... params) |
static <T> java.lang.reflect.Constructor<T>[] |
getPublicConstructors(java.lang.Class<T> c) |
static java.lang.reflect.Field |
getPublicField(java.lang.Class<?> c,
java.lang.String name) |
static java.lang.reflect.Field[] |
getPublicFields(java.lang.Class<?> c) |
static java.lang.reflect.Method |
getPublicMethod(java.lang.Class<?> c,
java.lang.String name,
java.lang.Class<?>... params) |
static java.lang.reflect.Method[] |
getPublicMethods(java.lang.Class<?> c) |
static java.lang.Object |
invoke(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Class<?>[] paramTypes,
java.lang.Object inst,
java.lang.Object... params)
Uses reflection to invoke a method for you; using this method will net you
convenience in a JRE environment, and maximal efficiency in a GWT
environment.
|
static java.lang.Object |
jsniGet(java.lang.Object array,
int index) |
static int |
jsniLength(java.lang.Object array) |
static <T> java.lang.Class<T> |
magicClass(java.lang.Class<? extends T> cls)
Ensures that a given class has all its reflection data filled in.
|
static <T> T[] |
newArray(java.lang.Class<T> classLit,
int size)
For the time being you MUST send only class literals to this method.
|
static <T> T[][] |
newArray(java.lang.Class<T> classLit,
int dim1,
int dim2)
For the time being you MUST send only class literals to this method.
|
public static java.lang.Object arrayGet(java.lang.Object array,
int index)
Array.get(Object, int).
Note that JREs will throw IndexOutOfBoundsException, while Gwt will
not.
array - -> The array to load fromindex - -> The index to load from.public static int arrayLength(java.lang.Object array)
array - - Any array[] instance; java or jspublic static int constId(java.lang.Class<?> c)
c - -> The class whose unique int identifier we should return
In JVMs, hotswapped classes that should == will have different constIds. GWT prod overrides returns a field, .constId, that we added to Class.java via supersource.
Note that, in both cases, the ID returned is sequential, and will be neither unique nor stable across multiple runtimes; multiple Gwt applications will reuse sequential IDs, and multiple classes loaded from different ClassLoaders or in different JVMs will assign random hashCodes to each class.
@MagicMethod(documentation="Generated by com.google.gwt.reflect.rebind.injectors.ConstructInjector") public static <T> T construct(java.lang.Class<? extends T> cls, java.lang.Class<?>[] paramSignature, java.lang.Object... params) throws java.lang.Throwable
cls - - The class on which to call .newInstance();paramSignature - - The constructor parameter signature. The array and it's contents must be
constants.params - - The actual objects (which should be assignable to param signature).java.lang.Throwable - - Standard reflection exceptions in java vms, generator-base exceptions in
js vms. InvocationTargetExceptions are unwrapped for you. This also forces
you to catch Errors, which may very well be thrown by gwt, or by the jvmpublic static java.lang.String escape(java.lang.String unescaped)
Generator.escape(String)unescaped, suitable for being
enclosed in double quotes in Java sourcepublic static <T> T fieldGet(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
cls - - * The class on which to invoke a field get.name - - * The name of the field to get from.inst - - The instance object to get from (null for static fields)java.lang.SecurityExceptionjava.lang.NoSuchFieldExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic static boolean fieldGetBoolean(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
cls - - * The class on which to invoke a field get.name - - * The name of the field to get from.inst - - The instance object to get from (null for static fields)java.lang.SecurityExceptionjava.lang.NoSuchFieldExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic static byte fieldGetByte(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
cls - - * The class on which to invoke a field get.name - - * The name of the field to get from.inst - - The instance object to get from (null for static fields)java.lang.SecurityExceptionjava.lang.NoSuchFieldExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic static char fieldGetChar(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
cls - - * The class on which to invoke a field get.name - - * The name of the field to get from.inst - - The instance object to get from (null for static fields)java.lang.SecurityExceptionjava.lang.NoSuchFieldExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic static double fieldGetDouble(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
cls - - * The class on which to invoke a field get.name - - * The name of the field to get from.inst - - The instance object to get from (null for static fields)java.lang.SecurityExceptionjava.lang.NoSuchFieldExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic static float fieldGetFloat(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
cls - - * The class on which to invoke a field get.name - - * The name of the field to get from.inst - - The instance object to get from (null for static fields)java.lang.SecurityExceptionjava.lang.NoSuchFieldExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic static int fieldGetInt(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
cls - - * The class on which to invoke a field get.name - - * The name of the field to get from.inst - - The instance object to get from (null for static fields)java.lang.SecurityExceptionjava.lang.NoSuchFieldExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic static long fieldGetLong(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
cls - - * The class on which to invoke a field get.name - - * The name of the field to get from.inst - - The instance object to get from (null for static fields)java.lang.SecurityExceptionjava.lang.NoSuchFieldExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic static void fieldGetLong(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst,
long value)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
cls - - * The class on which to invoke a field get.name - - * The name of the field to get from.inst - - The instance object to get from (null for static fields)value - - The long value to set to the field. Calls:
cls.get(Declared)Field(name).setLong(inst, value); // Checks for declared
methods firstjava.lang.SecurityExceptionjava.lang.NoSuchFieldExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic static short fieldGetShort(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
cls - - * The class on which to invoke a field get.name - - * The name of the field to get from.inst - - The instance object to get from (null for static fields)java.lang.SecurityExceptionjava.lang.NoSuchFieldExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic static void fieldSet(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst,
java.lang.Object value)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
cls - - * The class on which to invoke a field get.name - - * The name of the field to get from.inst - - The instance object to get from (null for static fields)value - - The object value to set to the field. Calls:
cls.get(Declared)Field(name).set(inst, value); // Checks for declared
methods first Primitive boxing will NOT work here!java.lang.SecurityExceptionjava.lang.NoSuchFieldExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic static void fieldSetBoolean(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst,
boolean value)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
cls - - * The class on which to invoke a field get.name - - * The name of the field to get from.inst - - The instance object to get from (null for static fields)value - - The boolean value to set to the field. Calls:
cls.get(Declared)Field(name).setBoolean(inst, value); // Checks for
declared methods firstjava.lang.SecurityExceptionjava.lang.NoSuchFieldExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic static void fieldSetByte(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst,
byte value)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
cls - - * The class on which to invoke a field get.name - - * The name of the field to get from.inst - - The instance object to get from (null for static fields)value - - The byte value to set to the field. Calls:
cls.get(Declared)Field(name).setByte(inst, value); // Checks for declared
methods firstjava.lang.SecurityExceptionjava.lang.NoSuchFieldExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic static void fieldSetChar(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst,
char value)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
cls - - * The class on which to invoke a field get.name - - * The name of the field to get from.inst - - The instance object to get from (null for static fields)value - - The char value to set to the field. Calls:
cls.get(Declared)Field(name).setChar(inst, value); // Checks for declared
methods firstjava.lang.SecurityExceptionjava.lang.NoSuchFieldExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic static void fieldSetDouble(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst,
double value)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
cls - - * The class on which to invoke a field get.name - - * The name of the field to get from.inst - - The instance object to get from (null for static fields)value - - The double value to set to the field. Calls:
cls.get(Declared)Field(name).setDouble(inst, value); // Checks for declared
methods firstjava.lang.SecurityExceptionjava.lang.NoSuchFieldExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic static void fieldSetFloat(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst,
float value)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
cls - - * The class on which to invoke a field get.name - - * The name of the field to get from.inst - - The instance object to get from (null for static fields)value - - The float value to set to the field. Calls:
cls.get(Declared)Field(name).setFloat(inst, value); // Checks for declared
methods firstjava.lang.SecurityExceptionjava.lang.NoSuchFieldExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic static void fieldSetInt(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst,
int value)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
cls - - * The class on which to invoke a field get.name - - * The name of the field to get from.inst - - The instance object to get from (null for static fields)value - - The int value to set to the field. Calls:
cls.get(Declared)Field(name).setInt(inst, value); // Checks for declared
methods firstjava.lang.SecurityExceptionjava.lang.NoSuchFieldExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic static void fieldSetShort(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Object inst,
short value)
throws java.lang.SecurityException,
java.lang.NoSuchFieldException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
cls - - * The class on which to invoke a field get.name - - * The name of the field to get from.inst - - The instance object to get from (null for static fields)value - - The short value to set to the field. Calls:
cls.get(Declared)Field(name).setShort(inst, value); // Checks for declared
methods firstjava.lang.SecurityExceptionjava.lang.NoSuchFieldExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic static <T> java.lang.reflect.Constructor<T> getDeclaredConstructor(java.lang.Class<T> c,
java.lang.Class<?>... params)
public static <T> java.lang.reflect.Constructor<T>[] getDeclaredConstructors(java.lang.Class<T> c)
public static java.lang.reflect.Field getDeclaredField(java.lang.Class<?> c,
java.lang.String name)
public static java.lang.reflect.Field[] getDeclaredFields(java.lang.Class<?> c)
public static java.lang.reflect.Method getDeclaredMethod(java.lang.Class<?> c,
java.lang.String name,
java.lang.Class<?>... params)
public static java.lang.reflect.Method[] getDeclaredMethods(java.lang.Class<?> c)
public static java.lang.Package getPackage(java.lang.String name)
public static <T> java.lang.reflect.Constructor<T> getPublicConstructor(java.lang.Class<T> c,
java.lang.Class<?>... params)
public static <T> java.lang.reflect.Constructor<T>[] getPublicConstructors(java.lang.Class<T> c)
public static java.lang.reflect.Field getPublicField(java.lang.Class<?> c,
java.lang.String name)
public static java.lang.reflect.Field[] getPublicFields(java.lang.Class<?> c)
public static java.lang.reflect.Method getPublicMethod(java.lang.Class<?> c,
java.lang.String name,
java.lang.Class<?>... params)
public static java.lang.reflect.Method[] getPublicMethods(java.lang.Class<?> c)
public static java.lang.Object invoke(java.lang.Class<?> cls,
java.lang.String name,
java.lang.Class<?>[] paramTypes,
java.lang.Object inst,
java.lang.Object... params)
throws java.lang.Throwable
cls - - * The class on which to invoke a method.name - - * The name of the method to invokeparamTypes - - * An array of classes matching that of the method to invokeinst - - The instance object to invoke the method as (null for static methods)params - - The actual parameters to send to the objectjava.lang.Throwable - - Throws throwable because InvocationTargetException is unwrapped for you.public static java.lang.Object jsniGet(java.lang.Object array,
int index)
public static int jsniLength(java.lang.Object array)
public static <T> java.lang.Class<T> magicClass(java.lang.Class<? extends T> cls)
cls - - The class to enhance in gwt production mode.public static <T> T[] newArray(java.lang.Class<T> classLit,
int size)
Returns a new Typed[size], null-initialized and properly typed. Utilizes standard java array reflection in gwt dev and plain jvms.
If you want to create multi dimensional arrays with only one dimension defined, just call SomeType[][][] array = newArray(SomeType[][].class, 2);
It you need to create primitive arrays, prefer
Array.newInstance(Class, int), which returns type Object, and cast
it yourself. Because this type signature is generic, int, double and
friends will auto-box. The only difference between this method and the one
from java.lang.reflect.Array is the return type is typesafely cast for you.
In gwt production mode, this method call is replaced with new T[dimensions[0]][dimensions[1]...[];
Failing to use a class literal will currently make the compiler fail, and will eventually resort to a runtime lookup in the ConstPool to get a seed array to clone.
classLit - - The class for which a new array will be created.size - - The size of the new array.public static <T> T[][] newArray(java.lang.Class<T> classLit,
int dim1,
int dim2)
Returns a two-dimensional array, with the inner two dimensions filled in. Utilizes standard java array reflection in gwt dev and plain jvms.
If you want to create complex multi-dimensional arrays this method will fill in the two inner dimensions of whatever class you send (array classes welcome). SomeType[][][][] array = newArray(SomeType[][].class, 4, 4);
It you need to create primitive arrays, or more complex multi-dimensional
arrays, prefer Array.newInstance(Class, int ...), which returns
type Object, and cast it yourself. Because this type signature is generic,
int, double and friends will auto-box. The only difference between this
method and the one from java.lang.reflect.Array is the return type is
typesafely cast for you.
In gwt production mode, this method call is replaced with new T[dimensions[0]][dimensions[1]...[];
Failing to use a class literal will currently make the compiler fail, and will eventually resort to a runtime lookup in the ConstPool to get a seed array to clone.
classLit - - The class for which a new array will be created.dim1 - - The size of the new array's inner dimension.dim1 - - The size of the new array's outer dimension.public static <T extends java.lang.Throwable> T doThrow(T exception)
throws T extends java.lang.Throwable
T extends java.lang.Throwable