Class ReflectionLibrary
public class ReflectionLibrary extends Object
This Class is used to gain access to fields and methods of other classes where the access modifier (private/protected/(none)/public) prohibits access to that field/method.
Furthermore, using this class methods can be called using the shared "system" user access rights provided by EDT.
NOTE: Use of this API is at your own discretion and risk. You will be fully responsible for the development, functioning, maintenance and service of your Application.
In no event will CASIO or CASIO Europe GmbH be liable for any special damages, including but not limited to costs of procurement of substitute goods or services or any special, indirect, incidental, exemplary, or consequential damages, including but not limited to lost profits, loss of goodwill, business interruption, or loss of information, of any party, including third parties, regardless of whether such party was advised of the possibility of the foregoing.
- Since:
- 1.00
- API Note:
- The Reflection Library is bound to the calling application on application startup time automatically.
The Library's lifecycle therefore depends on the application lifecycle.
Due to the Lifecycle of Android Applications and the underlying timing, it is strongly advised not to call any Library Methods inside theonCreate
method.
When the activity is being launched (and hence the process gets created), the same applies to theonStart
andonResume
methods.
If you need to call any Library methods at application start in one of the above mentioned methods, you should use theCallback
Mechanism offered by theonLibraryReady
method instead.
For instance, instead of callingReflectionLibrary.getBoolean(Object obj, String fieldName)
directly inonCreate
, use this code to postpone it to aCallback
appropriately:
ReflectionLibrary.onLibraryReady(new LibraryCallback() { public void onLibraryReady() { ReflectionLibrary.getBoolean(this, "booleanFieldName"); } });
Which can be simplified to:
ReflectionLibrary.onLibraryReady(() -> { ReflectionLibrary.getBoolean(this, "booleanFieldName"); });
-
Method Summary
Modifier and Type Method Description static boolean
getBoolean(Class<?> declaringClass, String fieldName)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.static boolean
getBoolean(Object obj, String fieldName)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.static byte
getByte(Class<?> declaringClass, String fieldName)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.static byte
getByte(Object obj, String fieldName)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.static char
getChar(Class<?> declaringClass, String fieldName)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.static char
getChar(Object obj, String fieldName)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.static double
getDouble(Class<?> declaringClass, String fieldName)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.static double
getDouble(Object obj, String fieldName)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.static float
getFloat(Class<?> declaringClass, String fieldName)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.static float
getFloat(Object obj, String fieldName)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.static int
getInt(Class<?> declaringClass, String fieldName)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.static int
getInt(Object obj, String fieldName)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.static long
getLong(Class<?> declaringClass, String fieldName)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.static long
getLong(Object obj, String fieldName)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.static short
getShort(Class<?> declaringClass, String fieldName)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.static short
getShort(Object obj, String fieldName)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.static String
getString(Class<?> declaringClass, String fieldName)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.static String
getString(Object obj, String fieldName)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.static Class<?>
getType(Class<?> declaringClass, String fieldName)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field type will be returned to the caller.static Class<?>
getType(Object obj, String fieldName)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field type will be returned to the caller.static Object
getValue(Class<?> declaringClass, String fieldName)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.static Object
getValue(Object obj, String fieldName)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.static Object
invokeMethod(Class<?> declaringClass, String methodName)
Searches for the Static Method specified by "methodName" within the given Class "declaringClass".
Once found, the method will be called (with no arguments) and the return value will be returned to the caller.static Object
invokeMethod(Class<?> declaringClass, String methodName, Class<?>[] classParams, Object[] params)
Searches for the Static Method specified by "methodName" within the given Class "declaringClass".
Once found, the method will be called (with given arguments from "params") and the return value will be returned to the caller.static Object
invokeMethod(Object obj, String methodName)
Searches for the Instance Method specified by "methodName" within the given Object "obj" back through it's inheritance chain.
Once found, the method will be called (with no arguments) and the return value will be returned to the caller.static Object
invokeMethod(Object obj, String methodName, Class<?>[] classParams, Object[] params)
Searches for the Instance Method specified by "methodName" within the given Object "obj" back through it's inheritance chain.
Once found, the method will be called (with given arguments from "params") and the return value will be returned to the caller.static boolean
isMethodSupported(String methodName)
static boolean
isMethodSupported(BigInteger method)
Check whether theMethod
indicated by theBigInteger
method parameter is supported on the currently active devicestatic void
onLibraryReady(LibraryCallback callback)
Add a new Callback to the Queue of Callbacks to be processed once the EDT Service becomes availablestatic void
setBoolean(Class<?> declaringClass, String fieldName, boolean value)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".static void
setBoolean(Object obj, String fieldName, boolean value)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".static void
setByte(Class<?> declaringClass, String fieldName, byte value)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".static void
setByte(Object obj, String fieldName, byte value)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".static void
setChar(Class<?> declaringClass, String fieldName, char value)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".static void
setChar(Object obj, String fieldName, char value)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".static void
setDouble(Class<?> declaringClass, String fieldName, double value)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".static void
setDouble(Object obj, String fieldName, double value)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".static void
setFloat(Class<?> declaringClass, String fieldName, float value)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".static void
setFloat(Object obj, String fieldName, float value)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".static void
setInt(Class<?> declaringClass, String fieldName, int value)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".static void
setInt(Object obj, String fieldName, int value)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".static void
setLong(Class<?> declaringClass, String fieldName, long value)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".static void
setLong(Object obj, String fieldName, long value)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".static void
setShort(Class<?> declaringClass, String fieldName, short value)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".static void
setShort(Object obj, String fieldName, short value)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".static void
setString(Class<?> declaringClass, String fieldName, String value)
Searches for a static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".static void
setString(Object obj, String fieldName, String value)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".static void
setValue(Class<?> declaringClass, String fieldName, Object value)
Searches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".static void
setValue(Object obj, String fieldName, Object value)
Searches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".
-
Method Details
-
isMethodSupported
Check whether theMethod
indicated by theBigInteger
method parameter is supported on the currently active device- Parameters:
method
-BigInteger
: Constant referencing the method to be checked- Returns:
boolean
:true
if the method is supported on the currently active device, otherwisefalse
- Throws:
IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.
-
isMethodSupported
Check whether theMethod
indicated by theString
methodName parameter is supported on the currently active device- Parameters:
methodName
-String
: Name of the method to be checked- Returns:
boolean
:true
if the method is supported on the currently active device, otherwisefalse
- Throws:
IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.
-
getBoolean
public static boolean getBoolean(Object obj, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
getBoolean
public static boolean getBoolean(Class<?> declaringClass, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.
-
getByte
public static byte getByte(Object obj, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
getByte
public static byte getByte(Class<?> declaringClass, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.
-
getChar
public static char getChar(Object obj, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
getChar
public static char getChar(Class<?> declaringClass, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.
-
getDouble
public static double getDouble(Object obj, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
getDouble
public static double getDouble(Class<?> declaringClass, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.
-
getFloat
public static float getFloat(Object obj, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
getFloat
public static float getFloat(Class<?> declaringClass, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.
-
getInt
public static int getInt(Object obj, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
getInt
public static int getInt(Class<?> declaringClass, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.
-
getLong
public static long getLong(Object obj, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
getLong
public static long getLong(Class<?> declaringClass, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.
-
getShort
public static short getShort(Object obj, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
getShort
public static short getShort(Class<?> declaringClass, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.
-
getString
public static String getString(Object obj, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
getString
public static String getString(Class<?> declaringClass, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.
-
getType
public static Class<?> getType(Object obj, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateException, ClassNotFoundExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field type will be returned to the caller.- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Field- Returns:
- The Field type
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.ClassNotFoundException
- Gets thrown when the given Class does not exist.- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
getType
public static Class<?> getType(Class<?> declaringClass, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateException, ClassNotFoundExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field type will be returned to the caller.- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Field- Returns:
- The Field type
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.ClassNotFoundException
- Gets thrown when the given Class does not exist.
-
getValue
public static Object getValue(Object obj, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be returned to the caller.- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
getValue
public static Object getValue(Class<?> declaringClass, String fieldName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be returned to the caller.- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Field- Returns:
- The Field value
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.
-
invokeMethod
public static Object invokeMethod(Object obj, String methodName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for the Instance Method specified by "methodName" within the given Object "obj" back through it's inheritance chain.
Once found, the method will be called (with no arguments) and the return value will be returned to the caller.- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Method resides inmethodName
- The name of the Method- Returns:
- The return value of the Method
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
invokeMethod
public static Object invokeMethod(Object obj, String methodName, Class<?>[] classParams, Object[] params) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for the Instance Method specified by "methodName" within the given Object "obj" back through it's inheritance chain.
Once found, the method will be called (with given arguments from "params") and the return value will be returned to the caller.- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Method resides inmethodName
- The name of the MethodclassParams
- Class Types of the arguments for calling the Method, e.g. Actor.class, float.class, int.classparams
- The arguments for calling the Method- Returns:
- The return value of the Method
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.- API Note:
- The
obj
andparams
parameters are supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
andparams
parameters at least implement theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
andparams
parameters as if they would implement theSerializable
Interface.
-
invokeMethod
public static Object invokeMethod(Class<?> declaringClass, String methodName) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for the Static Method specified by "methodName" within the given Class "declaringClass".
Once found, the method will be called (with no arguments) and the return value will be returned to the caller.- Parameters:
declaringClass
- The class where the Method resides inmethodName
- The name of the Method- Returns:
- The return value of the Method
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.
-
invokeMethod
public static Object invokeMethod(Class<?> declaringClass, String methodName, Class<?>[] classParams, Object[] params) throws RemoteException, UnsupportedOperationException, IllegalStateExceptionSearches for the Static Method specified by "methodName" within the given Class "declaringClass".
Once found, the method will be called (with given arguments from "params") and the return value will be returned to the caller.- Parameters:
declaringClass
- The class where the Method resides inmethodName
- The name of the MethodclassParams
- Class Types of the arguments for calling the Method, e.g. Actor.class, float.class, int.classparams
- The arguments for calling the Method- Returns:
- The return value of the Method
- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.IllegalStateException
- Gets thrown when the Library is not ready yet to accept method calls.
In such case, please useonLibraryReady
Method to add acallback
which then processes this method. See API Notes ofthis class
for further details.- API Note:
- The
params
parameters are supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theparams
parameters at least implement theSerializable
Interface.
Should this not be the case either, the method will try to treat theparams
parameters as if they would implement theSerializable
Interface.
-
setBoolean
public static void setBoolean(Object obj, String fieldName, boolean value) throws RemoteException, UnsupportedOperationExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
setBoolean
public static void setBoolean(Class<?> declaringClass, String fieldName, boolean value) throws RemoteException, UnsupportedOperationExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
-
setByte
public static void setByte(Object obj, String fieldName, byte value) throws RemoteException, UnsupportedOperationExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
setByte
public static void setByte(Class<?> declaringClass, String fieldName, byte value) throws RemoteException, UnsupportedOperationExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
-
setChar
public static void setChar(Object obj, String fieldName, char value) throws RemoteException, UnsupportedOperationExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
setChar
public static void setChar(Class<?> declaringClass, String fieldName, char value) throws RemoteException, UnsupportedOperationExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
-
setDouble
public static void setDouble(Object obj, String fieldName, double value) throws RemoteException, UnsupportedOperationExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
setDouble
public static void setDouble(Class<?> declaringClass, String fieldName, double value) throws RemoteException, UnsupportedOperationExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
-
setFloat
public static void setFloat(Object obj, String fieldName, float value) throws RemoteException, UnsupportedOperationExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
setFloat
public static void setFloat(Class<?> declaringClass, String fieldName, float value) throws RemoteException, UnsupportedOperationExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
-
setInt
public static void setInt(Object obj, String fieldName, int value) throws RemoteException, UnsupportedOperationExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
setInt
public static void setInt(Class<?> declaringClass, String fieldName, int value) throws RemoteException, UnsupportedOperationExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
-
setLong
public static void setLong(Object obj, String fieldName, long value) throws RemoteException, UnsupportedOperationExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
setLong
public static void setLong(Class<?> declaringClass, String fieldName, long value) throws RemoteException, UnsupportedOperationExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
-
setShort
public static void setShort(Object obj, String fieldName, short value) throws RemoteException, UnsupportedOperationExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
setShort
public static void setShort(Class<?> declaringClass, String fieldName, short value) throws RemoteException, UnsupportedOperationExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
-
setString
public static void setString(Object obj, String fieldName, String value) throws RemoteException, UnsupportedOperationExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
setString
public static void setString(Class<?> declaringClass, String fieldName, String value) throws RemoteException, UnsupportedOperationExceptionSearches for a static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
-
setValue
public static void setValue(Object obj, String fieldName, Object value) throws RemoteException, UnsupportedOperationExceptionSearches for an Instance Field specified by "fieldName" within the given Object "obj" back through it's inheritance chain.
Once found, the Field value will be set to the value given by "value".- Parameters:
obj
- The instance Object where (or in which's inherited objects) the regarding Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
- API Note:
- The
obj
parameter is supposed to implement theParcelable
Interface.
Should this not be the case, it's recommended that theobj
parameter at least implements theSerializable
Interface.
Should this not be the case either, the method will try to treat theobj
parameter as if it would implement theSerializable
Interface.
-
setValue
public static void setValue(Class<?> declaringClass, String fieldName, Object value) throws RemoteException, UnsupportedOperationExceptionSearches for a Static Field specified by "fieldName" within the class "declaringClass".
If found, the Field value will be set to the value given by "value".- Parameters:
declaringClass
- The class where the Field resides infieldName
- The name of the Fieldvalue
- The value to set the Field to- Throws:
RemoteException
UnsupportedOperationException
-
onLibraryReady
public static void onLibraryReady(LibraryCallback callback) throws RemoteException, UnsupportedOperationExceptionAdd a new Callback to the Queue of Callbacks to be processed once the EDT Service becomes available- Parameters:
callback
-LibraryCallback
: Instance of theLibraryCallback
Interface which holds theonLibraryReady()
Method which will get called once the regarding library becomes available- Throws:
RemoteException
- Gets thrown when access to the system service fails.UnsupportedOperationException
- Gets thrown when the current device does not support this method.
-