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