Wraps a Java class to allow access to it's static fields and methods using JNI.
More...
#include <JavaClass.h>
List of all members.
Public Member Functions |
| JavaClass (JNIEnv *JNIEnvironment, const char *classPath) |
| Constructor taking the Java environment and the required class path.
|
virtual | ~JavaClass () |
bool | staticField (const char *fieldName, char **result) |
| Access a static String field of the Java class.
|
bool | staticField (const char *fieldName, int *result) |
| Access a static integer field of the Java class.
|
bool | staticMethod (const char *methodName, int **returnValue, const char *param01) |
| Call a static method with one parameter which returns an integer array within the Java class.
|
bool | staticMethod (const char *methodName, const char *param01, const char *param02) |
| Call a static method with two parameters which doesn't return a value within the Java class.
|
Private Attributes |
char * | classPath |
jclass | jClass |
JNIEnv * | JNIEnvironment |
bool | intialized |
Detailed Description
Wraps a Java class to allow access to it's static fields and methods using JNI.
Constructor & Destructor Documentation
MaliSDK::JavaClass::JavaClass |
( |
JNIEnv * |
JNIEnvironment, |
|
|
const char * |
classPath |
|
) |
| |
Constructor taking the Java environment and the required class path.
Checks for the existance of the class and prints an error if it can't be found.
- Parameters:
-
[in] | JNIEnvironment | A pointer to the JNI environment which allows interfacing with the Java Virtual Machine (JVM). Allows extensive interaction with the JVM including accessing Java classes, fields and methods. This pointer is provided as part of a JNI call from Java to C++. |
[in] | classPath | The class path to the Java class to wrap. |
MaliSDK::JavaClass::~JavaClass |
( |
| ) |
|
|
virtual |
Member Function Documentation
bool MaliSDK::JavaClass::staticField |
( |
const char * |
fieldName, |
|
|
char ** |
result |
|
) |
| |
Access a static String field of the Java class.
- Parameters:
-
[in] | fieldName | The name of the static field to access. |
[out] | result | Pointer to where the String value of the static field will be placed. |
- Returns:
- True if the operation was successful.
bool MaliSDK::JavaClass::staticField |
( |
const char * |
fieldName, |
|
|
int * |
result |
|
) |
| |
Access a static integer field of the Java class.
- Parameters:
-
[in] | fieldName | The name of the static field to access. |
[out] | result | Pointer to where the integer value of the static field will be placed. |
- Returns:
- True if the operation was successful.
bool MaliSDK::JavaClass::staticMethod |
( |
const char * |
methodName, |
|
|
int ** |
returnValue, |
|
|
const char * |
param01 |
|
) |
| |
Call a static method with one parameter which returns an integer array within the Java class.
- Parameters:
-
[in] | methodName | The name of the static method to call. |
[out] | returnValue | Pointer to an integer array where the return value of the static method will be placed. |
[in] | param01 | A parameter that will be passed to the static method of the Java class. |
- Returns:
- True if the operation was successful.
bool MaliSDK::JavaClass::staticMethod |
( |
const char * |
methodName, |
|
|
const char * |
param01, |
|
|
const char * |
param02 |
|
) |
| |
Call a static method with two parameters which doesn't return a value within the Java class.
- Parameters:
-
[in] | methodName | The name of the static method to call. |
[in] | param01 | The first parameter that will be passed to the static method of the Java class. |
[in] | param02 | The second parameter that will be passed to the static method of the Java class. |
- Returns:
- True if the operation was successful.
The documentation for this class was generated from the following files:
- simple-framework/inc/JavaClass.h
- simple-framework/src/JavaClass.cpp