-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial (incomplete) definition for
java/lang/Exception
and `ja…
…va/lang/Throwable`. Full syntax support for `env->ThrowNew` does not exist yet. Inherited methods/fields are not yet supported so these definitions are incomplete. PiperOrigin-RevId: 674307011
- Loading branch information
1 parent
644c12b
commit 690a918
Showing
7 changed files
with
126 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
** WARNING ** | ||
|
||
Class definitions in this directory may have their path change in the future, you may be better suited creating copies until full scrapes of APIs are provided in the future. | ||
|
||
These are used to bootstrap JNI Bind, but may change in the future, and may also be superseded by separate more complete definitions. | ||
|
||
Some definitions in this directory exist solely for phase 1 compilation and as such may be incomplete. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright 2024 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef JNI_BIND_CLASS_DEFS_JAVA_LANG_EXCEPTION_H_ | ||
#define JNI_BIND_CLASS_DEFS_JAVA_LANG_EXCEPTION_H_ | ||
|
||
#include "class_defs/java_lang_throwable.h" | ||
#include "implementation/class.h" | ||
#include "implementation/constructor.h" | ||
#include "implementation/method.h" | ||
#include "implementation/params.h" | ||
#include "implementation/return.h" | ||
#include "jni_dep.h" | ||
|
||
namespace jni { | ||
|
||
static constexpr Class kJavaLangException{ | ||
"java/lang/Exception", | ||
Constructor{}, | ||
Constructor<jstring>{}, | ||
Constructor{jstring{}, kJavaLangThrowable, jboolean{}, jboolean{}}, | ||
Constructor{kJavaLangThrowable}, | ||
|
||
// Inherited. | ||
Method{"getMessage", Return{jstring{}}, Params<>{}}, | ||
Method{"printStackTrace", Return{}, Params<>{}}, | ||
Method{"toString", Return{jstring{}}, Params<>{}}, | ||
}; | ||
|
||
} // namespace jni | ||
|
||
#endif // JNI_BIND_CLASS_DEFS_JAVA_LANG_EXCEPTION_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2024 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef JNI_BIND_CLASS_DEFS_JAVA_LANG_THROWABLE_H_ | ||
#define JNI_BIND_CLASS_DEFS_JAVA_LANG_THROWABLE_H_ | ||
|
||
#include "implementation/class.h" | ||
#include "implementation/constructor.h" | ||
#include "implementation/self.h" | ||
#include "jni_dep.h" | ||
|
||
namespace jni { | ||
|
||
static constexpr Class kJavaLangThrowable{ | ||
"java/lang/Throwable", | ||
Constructor{}, | ||
Constructor<jstring>{}, | ||
Constructor{jstring{}, Self{}}, | ||
Constructor{jstring{}, Self{}, jboolean{}, jboolean{}}, | ||
Constructor{Self{}}}; | ||
|
||
} // namespace jni | ||
|
||
#endif // JNI_BIND_CLASS_DEFS_JAVA_LANG_THROWABLE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters