Mason Ham wrote:
> It can be summarized in the following code that I added. I though you
> might want to add it in :-) /**
> * This will allow you to call a specific function from the command
> line.
> * It uses reflection to make the call. It is useful for "learning"
> how to write
> * ECS pages etc. It is simple reflection and so it assumes that any
> * method you are calling has no parameters.
> *
> * TODO: make it so that you can call with parameters etc
> *
> * @param method This is the method that you want to make the call
> on.
> * @param ecs This is the ecs testbed instance to call on.
> */
> private static void callMethod(String method, TestBed ecs){
> try{
> java.lang.reflect.Method meth = TestBed.class.getMethod(method, new
> Class[]{});
> meth.invoke(ecs , new Class[]{});
> } catch (Exception e){
> e.printStackTrace();
> }
> } You can then add this code to the main to make it happen.TestBed
> ecs = new TestBed(); if (args.length == 1) {
> callMethod(args[0], ecs);
> } ONE WORD OF WARNING. I didn't make this robust (obviously) so...if
> you don't pass in the right method name it will simply print a
> stacktrace and die :-(If others want me to extend it I could ... but
> this was all I needed ;-)
hi
things are often a little slow on this list so i thought i'd better
offer some advice before you die of old age ;-)
the usual advice on submitting code is - make a patch! *but* make it
right! (i should know about that last one, it's taken me long enough ;-)
choices:
1. get involved! read the jakarta website submission guildlines +
inwardly digest them; get the latest version of ECS checked out of cvs
and make a patch. (IMHO best option)
2. i can make the patch for you - but i got a bit confused when i looked
at the code today - i need to know where this change belongs (ECS 1.4
has two TestBed classes and various TestBed1, TestBed2 and TestBed3
classes) so i can compile an example and take a look.
3. walk away... (and see your all lovely code go to waste)
- robert
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]