The java::field Command


Usage:

java::field ?-noconvert? objOrClass field ?value field value ...?

The java::field command is used to manipulate public fields from Tcl. The objOrClass argument specifies either a fully qualified name of the declaring class of the field to access, or an object handle. The field argument specifies which field to manipulate. If an additional value parameter exists, then the field will be set to value, otherwise the current value of the field is returned. Multiple fields may be set via additional parameters by alternating field signatures and values. A full field signature is is required to specify shadowed fields of superclasses.

The java::field command also supports getting the compiler simulated "class" field on a java.lang.Class Object. This is the preferred method to get a handle to a named class.

% set cl [java::field java.util.Hashtable class]
% java::info class $cl
java.lang.Class

The Conversions section describes the effect of the optional -noconvert flag on the result.

Copyright © 1997-1998 Sun Microsystems, Inc.