Hairy Java related question
Hairy Java related question
- Subject: Hairy Java related question
- From: Ray Ackland <email@hidden>
- Date: Fri, 24 Oct 2003 23:41:48 +1300
Hi. While not strictly related to WO, hope to be able to get an answer
here.
In a reporting module I am currently working on, I am letting the user
select one of the main entities involved in the application (eg client,
supervisor etc). The next step is for the application to get some
information about the entity by calling a static method in the entity
called availableProperties(). This just returns a dictionary of the
things I want to be available in the query window.
Now I have an entity passed to the application as a string. I can
convert this into a class by using
java.lang.Class.forName(java.lang.String) method. But my next step
would be to call the availableProperties method on that class.
The problem I have is the type checking of the compiler doesn't know
about the mentioned static method, as I can't type it at this stage
because I don't know what the class will be yet. How do I get around
this?
Just as I finish writing this, I start to think that using an interface
may be the way. Any comments? Would that be the solution, and what do I
need to do in the calling code to get it to type check against the
interface?
Ray.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.