Re: Class loading

[email protected] Thu, 19 Aug 2010 12:26:14 +0530
Newsgroups gmane.comp.java.beanshell.devel
Message-ID <OFBE209A19.3831F383-ON65257784.0025E62F-65257784.00261BB4@inautix.co.in>
This is a multipart message in MIME format.
--===============2035538828739361286==
Content-Type: multipart/alternative;
	boundary="=_alternative 00261BB165257784_="

This is a multipart message in MIME format.
--=_alternative 00261BB165257784_=
Content-Type: text/plain; charset="US-ASCII"

thanks for you reply, harlon. I would like to know how the packages are 
run before executing the java statement? any idea where to find the source 
in the beanshell library. 
Is the package finding is like this, iterate the available packages using 
the java.lang.Package and match each package with the input class name 
string, for ex "String" or "InputStream" or "JButton".

Thanks
V

---------------------


The interpreter maintains a global import list, just like a compiler.
If an interpreter is created and a series of import commands run
before a statement like that is seen, the interpreter uses that import
list to resolve unqualified classnames. I forget where the code to do
that is, but there is no magic. There is also a small list of default
packages that are always imported, I think.

On Wed, Aug 18, 2010 at 9:35 PM,  <[email protected]> wrote:
>
> Hei,
>
> Interpreter i = new Interpreter();
> i.eval("String s = new String(\"Hello World!\");");
>
> In the above Java statement i wish to know how the beanshell invokes the
> class "String" without its package being specified. How does it 
associates
> the namespace.
>
> I have a small requirement like this, to dynamically invoke simple Java
> statements and invoke Java classes dynamically. I have a small 
interpreter
> developed for this. As the requirement is urgent, although i had read 
few
> sources of beanshell i would like to get the answer from the experienced
> than by finding all my myself.
>
> Thanks
>
> V
> 
------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> Beanshell-developers mailing list
> Beanshell-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/beanshell-developers
>
>

--=_alternative 00261BB165257784_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">thanks for you reply, harlon. I would
like to know how the packages are run before executing the java statement?
any idea where to find the source in the beanshell library. </font>
<br><font size=2 face="sans-serif">Is the package finding is like this,
iterate the available packages using the java.lang.Package and match each
package with the input class name string, for ex &quot;String&quot; or
&quot;InputStream&quot; or &quot;JButton&quot;.</font>
<br>
<br><font size=2 face="sans-serif">Thanks</font>
<br><font size=2 face="sans-serif">V</font>
<br>
<br><font size=2 face="sans-serif">---------------------</font>
<br>
<br>
<br><tt><font size=2>The interpreter maintains a global import list, just
like a compiler.<br>
If an interpreter is created and a series of import commands run<br>
before a statement like that is seen, the interpreter uses that import<br>
list to resolve unqualified classnames. I forget where the code to do<br>
that is, but there is no magic. There is also a small list of default<br>
packages that are always imported, I think.<br>
<br>
On Wed, Aug 18, 2010 at 9:35 PM, &nbsp;&lt;[email protected]&gt;
wrote:<br>
&gt;<br>
&gt; Hei,<br>
&gt;<br>
&gt; Interpreter i = new Interpreter();<br>
&gt; i.eval(&quot;String s = new String(\&quot;Hello World!\&quot;);&quot;);<br>
&gt;<br>
&gt; In the above Java statement i wish to know how the beanshell invokes
the<br>
&gt; class &quot;String&quot; without its package being specified. How
does it associates<br>
&gt; the namespace.<br>
&gt;<br>
&gt; I have a small requirement like this, to dynamically invoke simple
Java<br>
&gt; statements and invoke Java classes dynamically. I have a small interpreter<br>
&gt; developed for this. As the requirement is urgent, although i had read
few<br>
&gt; sources of beanshell i would like to get the answer from the experienced<br>
&gt; than by finding all my myself.<br>
&gt;<br>
&gt; Thanks<br>
&gt;<br>
&gt; V<br>
&gt; ------------------------------------------------------------------------------<br>
&gt; This SF.net email is sponsored by<br>
&gt;<br>
&gt; Make an app they can't live without<br>
&gt; Enter the BlackBerry Developer Challenge<br>
&gt; </font></tt><a href="http://p.sf.net/sfu/RIM-dev2dev"><tt><font size=2>http://p.sf.net/sfu/RIM-dev2dev</font></tt></a><tt><font size=2><br>
&gt; _______________________________________________<br>
&gt; Beanshell-developers mailing list<br>
&gt; Beanshell-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org<br>
&gt; </font></tt><a href="https://lists.sourceforge.net/lists/listinfo/beanshell-developers"><tt><font size=2>https://lists.sourceforge.net/lists/listinfo/beanshell-developers</font></tt></a><tt><font size=2><br>
&gt;<br>
&gt;<br>
</font></tt>
--=_alternative 00261BB165257784_=--


--===============2035538828739361286==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
--===============2035538828739361286==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Beanshell-developers mailing list
Beanshell-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/beanshell-developers

--===============2035538828739361286==--