Skip to content

Commit 553d552

Browse files
committed
Add introspection functions to the README
1 parent bb06ed1 commit 553d552

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,12 @@ FUNCTIONS
283283
You can pass a single integer to make a 1-dimensional array of that length.
284284
:return: The newly allocated array
285285

286+
java_source(data)
287+
Try to find the source code using SciJava's SourceFinder.
288+
:param data:
289+
The object or class or fully qualified class name to check for source code.
290+
:return: The URL of the java class
291+
286292
jclass(data)
287293
Obtain a Java class object.
288294

@@ -319,6 +325,14 @@ FUNCTIONS
319325
:param jtype: The Java type, as either a jimported class or as a string.
320326
:return: True iff the object is an instance of that Java type.
321327

328+
jreflect(data, aspect: str) -> List[Dict[str, Any]]
329+
Use Java reflection to introspect the given Java object,
330+
returning a table of its available methods or fields.
331+
332+
:param data: The object or class or fully qualified class name to inspect.
333+
:param aspect: Either "methods" or "fields"
334+
:return: List of dicts with keys: "name", "static", "arguments", and "returns".
335+
322336
jstacktrace(exc) -> str
323337
Extract the Java-side stack trace from a Java exception.
324338

@@ -427,6 +441,11 @@ FUNCTIONS
427441

428442
:raise RuntimeError: if this method is called while in Jep mode.
429443

444+
src(data)
445+
Print the source code URL for a Java class, object, or class name.
446+
447+
:param data: The Java class, object, or fully qualified class name as string
448+
430449
start_jvm(options=None) -> None
431450
Explicitly connect to the Java virtual machine (JVM). Only one JVM can
432451
be active; does nothing if the JVM has already been started. Calling

0 commit comments

Comments
 (0)