Skip to content

Commit ea96bba

Browse files
committed
#155: Add documentation for behavior regarding classes' access
1 parent 5307912 commit ea96bba

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,12 @@ However, it also supports console logging, which is configured with setting the
802802

803803
Accepted values are `debug`, `info`, `warn`, `error` and `disabled`.
804804

805+
### Can I access private or protected methods of classes using `j4rs`?
806+
807+
`j4rs` is not designed to interfere with Classes' access definitions. It calls Java just like normal Java code calls APIs of other packages.
808+
809+
This keeps things simple, enforces cleaner code design, applies better security and behavior predictability and offers better compatibility with different JDK versions.
810+
805811
## More documentation
806812

807813
If you did not find here what you wanted, you may have a look at these advanced j4rs use cases [here](./documentation/advanced_j4rs.md).

rust/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ let instance = jvm.create_instance("java.lang.String", instantiation_args.as_ref
288288
jvm.cast(&instance, "java.lang.Object")?;
289289
```
290290

291-
### Java arrays and variadics (varargs)
291+
### Java arrays and variadics
292292

293293
```rust
294294
// Create a Java array of Strings `String []`
@@ -319,8 +319,6 @@ let doubles_array = InvocationArg::try_from(
319319
)?;
320320
```
321321

322-
__Note__: variadics (or varargs) are actually arrays in Java. A Java method that takes variadics as argument may be called by creating an array and putting it in an `InvocationArg` as described above.
323-
324322
### Java Generics
325323

326324
```rust
@@ -804,9 +802,15 @@ However, it also supports console logging, which is configured with setting the
804802

805803
Accepted values are `debug`, `info`, `warn`, `error` and `disabled`.
806804

805+
### Can I access private or protected methods of classes using `j4rs`?
806+
807+
`j4rs` is not designed to interfere with Classes' access definitions. It calls Java just like normal Java code calls APIs of other packages.
808+
809+
This keeps things simple, enforces cleaner code design, applies better security and behavior predictability and offers better compatibility with different JDK versions.
810+
807811
## More documentation
808812

809-
In case you did not find what you wanted, you may have a look at these advanced j4rs use cases [here](../documentation/advanced_j4rs.md).
813+
If you did not find here what you wanted, you may have a look at these advanced j4rs use cases [here](../documentation/advanced_j4rs.md).
810814

811815
## Licence
812816

0 commit comments

Comments
 (0)