Mali OpenGL ES SDK  2.0.0
A simple framework to aid development of OpenGL ES applications targeting ARM Mali platforms.
 All Classes Files Functions Variables Enumerations Enumerator
MaliSDK::JavaClass Class Reference

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]JNIEnvironmentA 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]classPathThe class path to the Java class to wrap.
MaliSDK::JavaClass::~JavaClass ( )
virtual

Default destructor.


Member Function Documentation

bool MaliSDK::JavaClass::staticField ( const char *  fieldName,
char **  result 
)

Access a static String field of the Java class.

Parameters:
[in]fieldNameThe name of the static field to access.
[out]resultPointer 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]fieldNameThe name of the static field to access.
[out]resultPointer 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]methodNameThe name of the static method to call.
[out]returnValuePointer to an integer array where the return value of the static method will be placed.
[in]param01A 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]methodNameThe name of the static method to call.
[in]param01The first parameter that will be passed to the static method of the Java class.
[in]param02The 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: