"Fossies" - the Fresh Open Source Software archive

Member "jacl1.4.1/docs/TclJava/JavaConversions.html" of archive jacl1.4.1.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. Alternatively you can here view or download the uninterpreted source code. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.


Java Conversions


About:

Any command that returns a Java object or primitive Java type will automatically convert the object or primitive type to a corresponding Tcl value. This conversion can be skipped by using the -noconvert option. This applies to the java::call, java::field, java::prop, javaObj, and javaArrayObj commands. The java::new command does not do any conversion because it makes no sense to convert a Java object that was just allocated. If the returned value is a primitive Java type it will be converted to an integer or floating-point Tcl value. If the result is a String object, then the Java string object is converted into a Tcl string. For all other object types, a Java object handle is created and returned. If the -noconvert option is specified a Java object handle is always returned.

Tcl values are also be converted to Java objects and primitive Java types when they are given as arguments to Java commands. The default conversion for all Tcl values is a java.lang.String object. To override this default a full signature must be provided for Java method invocations.

Copyright © 1997-1998 Sun Microsystems, Inc.