WPILibC++ 2023.4.3
wpi::java::JException Class Reference

Finds an exception class and keep it as a global reference. More...

#include <wpi/jni_util.h>

Inheritance diagram for wpi::java::JException:
wpi::java::JClass

Public Member Functions

 JException ()=default
 
 JException (JNIEnv *env, const char *name)
 
void Throw (JNIEnv *env, jstring msg)
 
void Throw (JNIEnv *env, std::string_view msg)
 
 operator bool () const
 
- Public Member Functions inherited from wpi::java::JClass
 JClass ()=default
 
 JClass (JNIEnv *env, const char *name)
 
void free (JNIEnv *env)
 
 operator bool () const
 
 operator jclass () const
 

Additional Inherited Members

- Protected Attributes inherited from wpi::java::JClass
jclass m_cls = nullptr
 

Detailed Description

Finds an exception class and keep it as a global reference.

Similar to JClass, but provides Throw methods. Use with caution, as the destructor does NOT call DeleteGlobalRef due to potential shutdown issues with doing so.

Constructor & Destructor Documentation

◆ JException() [1/2]

wpi::java::JException::JException ( )
default

◆ JException() [2/2]

wpi::java::JException::JException ( JNIEnv *  env,
const char *  name 
)
inline

Member Function Documentation

◆ operator bool()

wpi::java::JException::operator bool ( ) const
inlineexplicit

◆ Throw() [1/2]

void wpi::java::JException::Throw ( JNIEnv *  env,
jstring  msg 
)
inline

◆ Throw() [2/2]

void wpi::java::JException::Throw ( JNIEnv *  env,
std::string_view  msg 
)
inline

The documentation for this class was generated from the following file: