We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps. .
Frank
On Tue, Jun 03, 2003 at 01:14:14PM +0200, Froehlich, Frank wrote:
>.
This feature has been requested before and sounds like it could be useful.
JDK1.5 supports static imports, which are similar (for static methods and
fields) so we might support this when we add that compatability at some
point...
In the mean time it wouldn't be hard to write a script that reads all
of the methods in an object and makes corresponding scripted methods that
delegate to it... Take a look at the BeanShell javap() command (it's just
a script that lives in the jar file).
Pat
On Sat, Aug 02, 2003 at 11:38:26AM -0400, A. Kevin Baynes wrote:
>
> I've been trying to write the script that you discuss below. I can access
> all the methods, but I cannot find any way to delegate to the given objects
> methods.
>
> My general approach has been to create a method called 'addMethods(Object
> o)', I then reflect all the methods and call eval() on a dynamically
> generated method 'eval("someMethod(){ delegate() }")'.
Kevin - Sorry for not resonding sooner but I've been out of town for a week.
Two things -
1) Coincidentally the functionality of static imports (ala JDK1.5) and also
"dynamic" imports - which do exactly what you are trying to do have been
added for an upcoming release... I believe this functionality is also known
as a mix-in. It allows you to import an object instance into a namespace
and then access all of the object's methods and variables directly as if they
were in scope. e.g.
importObject( new HashMap() );
put("foo", "bar");
print( get("foo" );
I added this to support class generation (hint hint everyone... coming feature).
2) Now, on your stuff I didn't see anything obviously wrong with your delegate
generator code, but I didn't try to run it... I'll look at it again when
I get a moment.
Pat