blob: 6fc6566daa81243a73dd96d5641dd298018b61c6 [file] [log] [blame]
#ifndef __JAVA_LANG_HPP__
#define __JAVA_LANG_HPP__
#include <jvm/jvm.hpp>
namespace java {
namespace lang {
class Throwable : public Jvm::Object
{
public:
explicit Throwable(const std::string& message)
{
static Jvm::Constructor constructor = Jvm::get()->findConstructor(
Jvm::Class::named("java/lang/Throwable")
.constructor()
.parameter(Jvm::get()->stringClass));
object = Jvm::get()->invoke(constructor, Jvm::get()->string(message));
}
private:
friend void Jvm::check(JNIEnv* env); // For constructing default instances.
Throwable() {}
};
} // namespace lang {
} // namespace java {
#endif // __JAVA_LANG_HPP__