public class ReflectionUtil extends Object
Constructor | Description |
---|---|
ReflectionUtil() |
Modifier and Type | Method | Description |
---|---|---|
static void |
addInterfacesToHashtable(Hashtable interfacesHashtable,
Class checkClass) |
|
static boolean |
callMethod_B(Object o,
String methodName) |
call a method which returns a boolean
Examples
boolean value = callMethod_B(ds, "getReturnExtendedMetaData");
|
static boolean |
callMethod_B(Object o,
String methodName,
int i) |
call a method which returns a boolean
Examples
boolean value = callMethod_B(connection, "isValid", 60)
|
static boolean |
callMethod_B(Object o,
String methodName,
Class x) |
call a method which returns a boolean
Examples
boolean value = callMethod_B(ds, "isWrapperFor",
Class.forName("java.lang.String");
|
static boolean |
callMethod_B(Object o,
String methodName,
Object parm1) |
|
static int |
callMethod_I(Object o,
String methodName) |
call a method which returns an integer
Examples
int value = callMethod_I(ds, "getMaximumPrecision");
|
static int |
callMethod_I(Object o,
String methodName,
int parm) |
call a method which returns an integer
Examples
int value = callMethod_I(ds, "getMaximumPrecision");
|
static int |
callMethod_I(Object o,
String methodName,
Object parm1) |
|
static long |
callMethod_L(Object o,
String methodName) |
call a method which returns an long
Examples
int value = callMethod_L(ds, "length");
|
static Object |
callMethod_O(Object o,
String methodName) |
call a method which returns an Object
Examples
Object o = callMethod_O(ds, ...
|
static Object |
callMethod_O(Object o,
String methodName,
int i) |
call a method which returns an Object
Examples
Object o = callMethod_O(ds, ...
|
static Object |
callMethod_O(Object o,
String methodName,
long i,
long j) |
call a method which returns an Object
Examples
Object o = callMethod_O(ds, ...
|
static Object |
callMethod_O(Object o,
String methodName,
Class c) |
call a method which returns an Object
Examples
Object o = callMethod_O(ds, ...
|
static Object |
callMethod_O(Object o,
String methodName,
Class[] argTypes,
Object p1,
Object p2) |
call a method which returns an Object
Examples
Object o = callMethod_O(ds, ...
|
static Object |
callMethod_O(Object o,
String methodName,
Class[] argTypes,
Object p1,
Object p2,
Object p3) |
call a method which returns an Object
Examples
Object o = callMethod_O(ds, ...
|
static Object |
callMethod_O(Object o,
String methodName,
Class[] argTypes,
Object p1,
Object p2,
Object p3,
Object p4) |
call a method which returns an Object
Examples
Object o = callMethod_O(ds, ...
|
static Object |
callMethod_O(Object o,
String methodName,
Class argType,
Object p1) |
call a method which returns an Object
Examples
Object o = callMethod_O(ds, ...
|
static Object |
callMethod_O(Object o,
String methodName,
String s,
Object parm2) |
call a method which returns an Object
Examples
Object o = callMethod_O(ds, ...
|
static Object |
callMethod_OS(Object o,
String methodName,
String s) |
call a method which returns an Object
Examples
Object o = callMethod_O(ds, ...
|
static Object |
callMethod_OSA(Object o,
String methodName,
String s1,
Object[] o2) |
|
static Object |
callMethod_OSS(Object o,
String methodName,
String s1,
String s2) |
|
static Object |
callMethod_OSSS(Object o,
String methodName,
String s1,
String s2,
String s3) |
|
static Object |
callMethod_OSSSS(Object o,
String methodName,
String s1,
String s2,
String s3,
String s4) |
|
static String |
callMethod_S(Object o,
String methodName) |
call a method which returns a string
Examples
String property = callMethod_S(ds, "getTranslateHex");
|
static String |
callMethod_S(Object o,
String methodName,
int i) |
call a method which returns a string
Examples
String property = callMethod_S(ds, "getTranslateHex");
|
static String |
callMethod_S(Object o,
String methodName,
long l,
int j) |
call a method which returns a string
Examples
String property = JDReflectionUtil.callMethod_S(outNClob, "getSubString",
1, outLength);
|
static void |
callMethod_V(Object o,
String methodName) |
call a method which returns nothing and is passed nothing
Examples
callMethod_V(ds, "close");
|
static void |
callMethod_V(Object o,
String methodName,
boolean parm1) |
call a method which returns nothing, but is passed an boolean
Examples
callMethod_V(ds, "setReturnExtendedMetaData", true);
|
static void |
callMethod_V(Object o,
String methodName,
byte[] parm1) |
call a method which returns nothing, but is passed a byte array
Examples
callMethod_V(ds, "setTranslateHex", "character");
|
static void |
callMethod_V(Object o,
String methodName,
int parm1) |
call a method which returns nothing, but is passed an int
Examples
callMethod_V(ds, "setMaximumPrecision", 34);
|
static void |
callMethod_V(Object o,
String methodName,
int parameterIndex,
InputStream inputStream,
long length) |
call a method which returns nothing, but is passed int, InputStream, long
Examples
JDReflectionUtil.callMethod_V(ps, "setBlob", 1, is, (long) 4);
|
static void |
callMethod_V(Object o,
String methodName,
int parameterIndex,
Reader reader,
long length) |
call a method which returns nothing, but is passed int, Reader, long
Examples
JDReflectionUtil.callMethod_V(ps, "setClob", 1, r, (long) 4);
|
static void |
callMethod_V(Object o,
String methodName,
int i,
Object parm2) |
call a method which returns nothing, but is passed an integer and object
The method to be called is dynamically resolved
Examples
callMethod_V(ps, "psSetNClob", 1, "character");
|
static void |
callMethod_V(Object o,
String methodName,
int parm1,
String parm2) |
call a method which returns nothing, but is passed an int and a string
String
Examples
callMethod_V(ps, "setNString", 1, "character");
|
static void |
callMethod_V(Object o,
String methodName,
long l,
Object parm2) |
call a method which returns nothing, but is passed a long and object The
method to be called is dynamically resolved
Examples
callMethod_V(nclob, "setString", 1, "character");
|
static void |
callMethod_V(Object o,
String methodName,
Class[] argTypes,
Object[] args) |
call a method which returns nothing.
|
static void |
callMethod_V(Object o,
String methodName,
Object parm1) |
|
static void |
callMethod_V(Object o,
String methodName,
Object parm1,
boolean b) |
|
static void |
callMethod_V(Object o,
String methodName,
Object parm1,
int i) |
|
static void |
callMethod_V(Object o,
String methodName,
String parameterName,
Reader reader,
long length) |
call a method which returns nothing, but is passed String, Reader, long
Examples
JDReflectionUtil.callMethod_V(ps, "setClob", "C1", r, (long) 4);
|
static void |
callMethod_V(Object o,
String methodName,
String parm1,
Object parm2) |
|
static void |
callMethod_V(Object o,
String methodName,
String parm1,
String parm2) |
call a method which returns nothing, but is passed an string and a string
String
Examples
callMethod_V(ps, "setNString", "col1", "character");
|
static void |
callMethod_V_IS(Object o,
String methodName,
String parameterName,
InputStream inputStream,
long length) |
call a method which returns nothing, but is passed String, InputStream,
long
Examples
JDReflectionUtil.callMethod_V(ps, "setBlob", "col1", is, (long) 4);
|
static int |
callStaticMethod_I(String classname,
String methodName) |
call a static method whihc returns an int.
|
static Object |
callStaticMethod_O(String classname,
String methodName) |
call a static method whihc returns an object.
|
static Object |
createObject(String classname) |
create an object using reflection Examples
JDReflectionUtil.createObject("com.ibm.db2.jcc.DB2XADataSource")
callMethod_V(ds, "setTranslateHex", "character");
|
static Object |
createObject(String classname,
byte[] arg) |
create an object using reflection Examples
JDReflectionUtil.createObject("com.ibm.db2.app.DB2RowId", testArray)
|
static Object |
createObject(String classname,
String parameterClass,
Object arg) |
create an object using reflection Examples
JDReflectionUtil.createObject("javax.xml.transform.stax.StAXSource",
"javax.xml.stream.XMLStreamReader", xmlStreamReader);
|
static int |
getField_I(Object o,
String fieldName) |
get an integer field
Examples
int value = getField_I(ds, "getMaximumPrecision");
|
static void |
handleIte(InvocationTargetException ite) |
public static void handleIte(InvocationTargetException ite) throws Exception
ite
- Exception
public static Object callMethod_O(Object o, String methodName, Class argType, Object p1) throws Exception
o
- object in which to call the methodmethodName
- method to callargType
- type of the parameterp1
- parameterException
public static Object callMethod_O(Object o, String methodName, Class[] argTypes, Object p1, Object p2) throws Exception
o
- methodName
- argTypes
- p1
- p2
- Exception
public static Object callMethod_O(Object o, String methodName, Class[] argTypes, Object p1, Object p2, Object p3) throws Exception
o
- methodName
- argTypes
- p1
- p2
- p3
- Exception
public static Object callMethod_O(Object o, String methodName, Class[] argTypes, Object p1, Object p2, Object p3, Object p4) throws Exception
o
- methodName
- argTypes
- p1
- p2
- p3
- p4
- Exception
public static Object callMethod_O(Object o, String methodName) throws Exception
o
- methodName
- Exception
public static Object callMethod_O(Object o, String methodName, int i) throws Exception
o
- methodName
- i
- Exception
public static Object callMethod_O(Object o, String methodName, Class c) throws Exception
o
- methodName
- c
- Exception
public static Object callMethod_OS(Object o, String methodName, String s) throws Exception
o
- methodName
- s
- Exception
public static Object callMethod_OSS(Object o, String methodName, String s1, String s2) throws Exception
o
- methodName
- s1
- s2
- Exception
public static Object callMethod_OSA(Object o, String methodName, String s1, Object[] o2) throws Exception
o
- methodName
- s1
- o2
- Exception
public static Object callMethod_OSSS(Object o, String methodName, String s1, String s2, String s3) throws Exception
o
- methodName
- s1
- s2
- s3
- Exception
public static Object callMethod_OSSSS(Object o, String methodName, String s1, String s2, String s3, String s4) throws Exception
o
- methodName
- s1
- s2
- s3
- s4
- Exception
public static Object callMethod_O(Object o, String methodName, String s, Object parm2) throws Exception
o
- methodName
- s
- parm2
- Exception
public static Object callMethod_O(Object o, String methodName, long i, long j) throws Exception
o
- methodName
- i
- j
- Exception
public static String callMethod_S(Object o, String methodName) throws Exception
o
- methodName
- Exception
public static String callMethod_S(Object o, String methodName, int i) throws Exception
o
- methodName
- i
- Exception
public static String callMethod_S(Object o, String methodName, long l, int j) throws Exception
o
- methodName
- l
- j
- Exception
public static int callMethod_I(Object o, String methodName) throws Exception
o
- methodName
- Exception
public static int callMethod_I(Object o, String methodName, int parm) throws Exception
o
- methodName
- parm
- Exception
public static int callMethod_I(Object o, String methodName, Object parm1) throws Exception
o
- methodName
- parm1
- Exception
public static long callMethod_L(Object o, String methodName) throws Exception
o
- methodName
- Exception
public static boolean callMethod_B(Object o, String methodName) throws Exception
o
- methodName
- Exception
public static boolean callMethod_B(Object o, String methodName, int i) throws Exception
o
- methodName
- i
- Exception
public static boolean callMethod_B(Object o, String methodName, Class x) throws Exception
o
- methodName
- x
- Exception
public static boolean callMethod_B(Object o, String methodName, Object parm1) throws Exception
o
- methodName
- parm1
- Exception
public static void callMethod_V(Object o, String methodName, Class[] argTypes, Object[] args) throws Exception
o
- methodName
- argTypes
- args
- Exception
public static void callMethod_V(Object o, String methodName) throws Exception
o
- methodName
- Exception
public static void callMethod_V(Object o, String methodName, int parm1) throws Exception
o
- methodName
- parm1
- Exception
public static void callMethod_V(Object o, String methodName, int parm1, String parm2) throws Exception
o
- methodName
- parm1
- parm2
- Exception
public static void callMethod_V(Object o, String methodName, String parm1, String parm2) throws Exception
o
- methodName
- parm1
- parm2
- Exception
public static void callMethod_V(Object o, String methodName, boolean parm1) throws Exception
o
- methodName
- parm1
- Exception
public static void callMethod_V(Object o, String methodName, byte[] parm1) throws Exception
o
- methodName
- parm1
- Exception
public static void callMethod_V(Object o, String methodName, int i, Object parm2) throws Exception
o
- methodName
- i
- parm2
- Exception
public static void callMethod_V(Object o, String methodName, Object parm1, int i) throws Exception
o
- methodName
- parm1
- i
- Exception
public static void callMethod_V(Object o, String methodName, Object parm1, boolean b) throws Exception
o
- methodName
- parm1
- b
- Exception
public static void callMethod_V(Object o, String methodName, Object parm1) throws Exception
o
- methodName
- parm1
- Exception
public static void addInterfacesToHashtable(Hashtable interfacesHashtable, Class checkClass)
interfacesHashtable
- checkClass
- public static void callMethod_V(Object o, String methodName, String parm1, Object parm2) throws Exception
o
- methodName
- parm1
- parm2
- Exception
public static void callMethod_V(Object o, String methodName, long l, Object parm2) throws Exception
o
- methodName
- l
- parm2
- Exception
public static void callMethod_V(Object o, String methodName, int parameterIndex, InputStream inputStream, long length) throws Exception
o
- methodName
- parameterIndex
- inputStream
- length
- Exception
public static void callMethod_V_IS(Object o, String methodName, String parameterName, InputStream inputStream, long length) throws Exception
o
- methodName
- parameterName
- inputStream
- length
- Exception
public static void callMethod_V(Object o, String methodName, int parameterIndex, Reader reader, long length) throws Exception
o
- methodName
- parameterIndex
- reader
- length
- Exception
public static void callMethod_V(Object o, String methodName, String parameterName, Reader reader, long length) throws Exception
o
- methodName
- parameterName
- reader
- length
- Exception
public static Object callStaticMethod_O(String classname, String methodName) throws Exception
classname
- methodName
- Exception
public static int callStaticMethod_I(String classname, String methodName) throws Exception
classname
- methodName
- Exception
public static Object createObject(String classname) throws Exception
classname
- Exception
public static Object createObject(String classname, byte[] arg) throws Exception
classname
- arg
- Exception
public static Object createObject(String classname, String parameterClass, Object arg) throws Exception
classname
- parameterClass
- arg
- Exception
Copyright © 2024. All rights reserved.