PageRenderTime 38ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
HTML | 36 lines | 36 code | 0 blank | 0 comment | 0 complexity | 3f30ede3604375ad9d8003e036dafa03 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  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.73.2"><link rel="start" href="index.html" title="jEdit 4.3 User's Guide"><link rel="up" href="bsh-commands.html" title="Chapter 16. BeanShell Commands"><link rel="prev" 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 class="itemizedlist"><ul type="disc"><li><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef"><b class="fsfunc">bind</b>(</code></td><td>org.gjt.sp.jedit.bsh.This
  2.  </td><td><var class="pdparam">ths</var>, </td></tr><tr><td> </td><td>org.gjt.sp.jedit.bsh.Namespace
  3.  </td><td><var class="pdparam">namespace</var><code>)</code>;</td></tr></table></div><p>Binds the scripted object <em class="parameter"><code>ths</code></em> to
  4. <em class="parameter"><code>namespace</code></em>.</p></li><li><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">clear</b>(</code></td><td><code>void)</code>;</td><td> </td></tr></table></div><p>Clear all variables, methods, and imports from this
  5. namespace. If this namespace is the root, it will be reset to
  6. the default imports.</p></li><li><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">org.gjt.sp.jedit.bsh.This
  7. <b class="fsfunc">extend</b>(</code></td><td>org.gjt.sp.jedit.bsh.This
  8.  </td><td><var class="pdparam">object</var><code>)</code>;</td></tr></table></div><p>Creates a new BeanShell <code class="classname">This</code>
  9. scripted object that is a child of the parameter
  10. <em class="parameter"><code>object</code></em>.</p></li><li><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void
  11. <b class="fsfunc">importObject</b>(</code></td><td>Object
  12.  </td><td><var class="pdparam">object</var><code>)</code>;</td></tr></table></div><p>Import an object into this namespace. This is somewhat
  13. similar to Java 1.5 static class imports, except you can import
  14. the methods and fields of a Java object instance into a
  15. BeanShell namespace, for example:</p><div class="informalexample"><pre class="programlisting">Map map = new HashMap();
  16. importObject( map );
  17. put("foo", "bar");
  18. print( get("foo") ); // "bar"</pre></div></li><li><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">org.gjt.sp.jedit.bsh.This
  19. <b class="fsfunc">object</b>(</code></td><td><code>void)</code>;</td><td> </td></tr></table></div><p>Creates a new BeanShell <code class="classname">This</code>
  20. scripted object which can hold data members. You can use this to
  21. create an object for storing miscellaneous crufties, like
  22. so:</p><div class="informalexample"><pre class="programlisting">crufties = object();
  23. crufties.foo = "hello world";
  24. crufties.counter = 5;
  25. ...</pre></div></li><li><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef"><b class="fsfunc">setNameSpace</b>(</code></td><td>org.gjt.sp.jedit.bsh.Namespace
  26.  </td><td><var class="pdparam">namespace</var><code>)</code>;</td></tr></table></div><p>Set the namespace of the current scope to
  27. <em class="parameter"><code>namespace</code></em>.</p></li><li><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">org.gjt.sp.jedit.bsh.This
  28. <b class="fsfunc">super</b>(</code></td><td>String
  29.  </td><td><var class="pdparam">scopename</var><code>)</code>;</td></tr></table></div><p>Returns a reference to the BeanShell
  30. <code class="classname">This</code> object representing the enclosing
  31. method scope specified by <em class="parameter"><code>scopename</code></em>. This
  32. method work similar to the <code class="function">super</code> keyword
  33. but can refer to enclosing scope at higher levels in a hierarchy
  34. of scopes.</p></li><li><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">unset</b>(</code></td><td>String  </td><td><var class="pdparam">name</var><code>)</code>;</td></tr></table></div><p>Removes the variable named by <em class="parameter"><code>name</code></em>
  35. from the current interpreter namespace. This has the effect of
  36. &#8220;<span class="quote">undefining</span>&#8221; the variable.</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>