PageRenderTime 63ms CodeModel.GetById 54ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/www/tags/NOV_07_2009/htdocs/42docs/users-guide/bsh-commands-object.html

#
HTML | 37 lines | 37 code | 0 blank | 0 comment | 0 complexity | 2ace4c42d7fbebc2a365d115b67ddfa7 MD5 | raw file
 1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>BeanShell Object Management Commands</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="jEdit 4.2 User's Guide"><link rel="up" href="bsh-commands.html" title="Chapter 16. BeanShell Commands"><link rel="previous" href="bsh-commands-script.html" title="Script Execution Commands"><link rel="next" href="bsh-commands-other.html" title="Other Commands"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">BeanShell Object Management Commands</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bsh-commands-script.html">Prev</a> </td><th width="60%" align="center">Chapter 16. BeanShell Commands</th><td width="20%" align="right"> <a accesskey="n" href="bsh-commands-other.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="bsh-commands-object"></a>BeanShell Object Management Commands</h2></div></div><div></div></div><div class="itemizedlist"><ul type="disc"><li><div class="funcsynopsis"><p><code class="funcdef"><b class="fsfunc">bind</b>(</code>bsh.This <var class="pdparam">ths</var>, bsh.Namespace <var class="pdparam">namespace</var><code>)</code>;</p></div><p>
 2        Binds the scripted object <i class="parameter"><tt>ths</tt></i> to
 3        <i class="parameter"><tt>namespace</tt></i>.
 4      </p></li><li><div class="funcsynopsis"><p><code class="funcdef">void <b class="fsfunc">clear</b>(</code><code>void)</code>;</p></div><p>
 5        Clear all variables, methods, and imports from this namespace.
 6        If this namespace is the root, it will be reset to the default
 7        imports.
 8      </p></li><li><div class="funcsynopsis"><p><code class="funcdef">bsh.This <b class="fsfunc">extend</b>(</code>bsh.This <var class="pdparam">object</var><code>)</code>;</p></div><p>
 9        Creates a new BeanShell <tt class="classname">This</tt> scripted object
10        that is a child of the parameter <i class="parameter"><tt>object</tt></i>.
11      </p></li><li><div class="funcsynopsis"><p><code class="funcdef">void <b class="fsfunc">importObject</b>(</code>Object <var class="pdparam">object</var><code>)</code>;</p></div><p>
12        Import an object into this namespace. This is somewhat similar to Java 1.5 static class imports, except you can import the methods and fields of a Java object instance into
13        a BeanShell namespace, for example:
14      </p><div class="informalexample"><table border="0" bgcolor="#E0E0E0"><tr><td><pre class="programlisting">Map map = new HashMap();
15    importObject( map );
16    put("foo", "bar");
17    print( get("foo") ); // "bar"</pre></td></tr></table></div></li><li><div class="funcsynopsis"><p><code class="funcdef">bsh.This <b class="fsfunc">object</b>(</code><code>void)</code>;</p></div><p>
18        Creates a new BeanShell <tt class="classname">This</tt> scripted object which
19        can hold data members. You can use this to create an object for
20        storing miscellaneous crufties, like so:
21      </p><div class="informalexample"><table border="0" bgcolor="#E0E0E0"><tr><td><pre class="programlisting">crufties = object();
22crufties.foo = "hello world";
23crufties.counter = 5;
24...</pre></td></tr></table></div></li><li><div class="funcsynopsis"><p><code class="funcdef"><b class="fsfunc">setNameSpace</b>(</code>bsh.Namespace <var class="pdparam">namespace</var><code>)</code>;</p></div><p>
25        Set the namespace of the current scope to
26        <i class="parameter"><tt>namespace</tt></i>.
27      </p></li><li><div class="funcsynopsis"><p><code class="funcdef">bsh.This <b class="fsfunc">super</b>(</code>String <var class="pdparam">scopename</var><code>)</code>;</p></div><p>
28        Returns a reference to the BeanShell <tt class="classname">This</tt>
29        object representing the enclosing method scope specified
30        by <i class="parameter"><tt>scopename</tt></i>.  This method work similar to
31        the <tt class="function">super</tt> keyword but can refer to enclosing
32        scope at higher levels in a hierarchy of scopes.
33      </p></li><li><div class="funcsynopsis"><p><code class="funcdef">void <b class="fsfunc">unset</b>(</code>String <var class="pdparam">name</var><code>)</code>;</p></div><p>
34        Removes the variable named by <i class="parameter"><tt>name</tt></i> from
35        the current interpreter namespace.  This has the effect of
36        &#8220;<span class="quote">undefining</span>&#8221; the variable.
37      </p></li></ul></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bsh-commands-script.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="bsh-commands.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bsh-commands-other.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Script Execution Commands </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Other Commands</td></tr></table></div></body></html>