@@ -85,6 +85,24 @@ u'1.8.0_152-release'
8585
8686See the [jgo documentation](https:// github.com/ scijava/ jgo) for more about Maven endpoints.
8787
88+ # # Bootstrap a Java installation
89+
90+ ```python
91+ >> > from scyjava import config, jimport
92+ >> > config.set_java_constraints(fetch = True , vendor = ' zulu' , version = ' 17' )
93+ >> > System = jimport(' java.lang.System' )
94+ cjdk: Installing JDK zulu:17.0 .15 to / home/ chuckles/ .cache/ cjdk
95+ Download 100 % of 189.4 MiB | # #########| Elapsed Time: 0:00:02 Time: 0:00:02
96+ Extract | | # | 714 Elapsed Time: 0:00:01
97+ cjdk: Installing Maven to / home/ chuckles/ .cache/ cjdk
98+ Download 100 % of 8.7 MiB | # #########| Elapsed Time: 0:00:00 Time: 0:00:00
99+ Extract | | # | 102 Elapsed Time: 0:00:00
100+ >> > System.getProperty(' java.vendor' )
101+ ' Azul Systems, Inc.'
102+ >> > System.getProperty(' java.version' )
103+ ' 17.0.15'
104+ ```
105+
88106# # Convert between Python and Java data structures
89107
90108# ## Convert Java collections to Python
@@ -135,7 +153,7 @@ AttributeError: 'list' object has no attribute 'stream'
135153Traceback (most recent call last):
136154 File " <stdin>" , line 1 , in < module>
137155TypeError : No matching overloads found for java.util.Set.addAll(set ), options are:
138- public abstract boolean java.util.Set.addAll(java.util.Collection)
156+ public abstract boolean java.util.Set.addAll(java.util.Collection)
139157>> > from scyjava import to_java as p2j
140158>> > jset.addAll(p2j(pset))
141159True
@@ -216,6 +234,22 @@ FUNCTIONS
216234 is_jarray(data: Any) -> bool
217235 Return whether the given data object is a Java array.
218236
237+ is_jboolean(the_type: type ) -> bool
238+
239+ is_jbyte(the_type: type ) -> bool
240+
241+ is_jcharacter(the_type: type ) -> bool
242+
243+ is_jdouble(the_type: type ) -> bool
244+
245+ is_jfloat(the_type: type ) -> bool
246+
247+ is_jinteger(the_type: type ) -> bool
248+
249+ is_jlong(the_type: type ) -> bool
250+
251+ is_jshort(the_type: type ) -> bool
252+
219253 is_jvm_headless() -> bool
220254 Return true iff Java is running in headless mode.
221255
@@ -267,6 +301,12 @@ FUNCTIONS
267301 You can pass a single integer to make a 1 - dimensional array of that length.
268302 :return : The newly allocated array
269303
304+ jsource(data)
305+ Try to find the source code using SciJava' s SourceFinder.
306+ :param data:
307+ The object or class or fully qualified class name to check for source code.
308+ :return : The URL of the java class
309+
270310 jclass(data)
271311 Obtain a Java class object .
272312
@@ -303,6 +343,14 @@ FUNCTIONS
303343 :param jtype: The Java type , as either a jimported class or as a string.
304344 :return : True iff the object is an instance of that Java type .
305345
346+ jreflect(data, aspect: str = " all" ) -> List[Dict[str , Any]]
347+ Use Java reflection to introspect the given Java object ,
348+ returning a table of its available methods or fields.
349+
350+ :param data: The object or class or fully qualified class name to inspect.
351+ :param aspect: One of: " all" , " constructors" , " fields" , or " methods" .
352+ :return : List of dicts with keys: " name" , " mods" , " arguments" , and " returns" .
353+
306354 jstacktrace(exc) -> str
307355 Extract the Java- side stack trace from a Java exception.
308356
0 commit comments