m0smith writes:
 > Hi,
 > 
 > I would love to help out but I need an example of what it should do. 
 > Its still a bit fuzzy in my mind what you need.

The OpenAccess class would include methods for invoking the private and 
protected static and instance methods and variables of any
class, e.g.,

  /*
   * Calls a static method.
  */
  public Object call(String class, String method, Object[] args);

  /*
   * Calls a static method.
  */
  public Object call(Class class, String method, Object[] args);

  /*
   * Calls an instance method.
  */
  public Object call(Object object, String method, Object[] args);

  /*
   * Sets a static variable.
  */
  public void set(String class, String variable, Object value);

  /*
   * Gets a static variable.
  */
  public Object get(String class, String variable);

The OpenAccess class would use Java reflection methods to access
private and protected members of a class. The class should be smart
enough to wrap and unwrap builtin types in the corresponding objects
and should throw appropriate exceptions, including an
InvalidTargetException (?) that wraps an exception thrown by the
private or protected method.

Paul




 > 
 > <snip>
 > > 
 > > Secondly, it would be nice to have a class member accessor
 > > class that would allow test points that do not reside in the
 > > same directory as the tested class to access the private and
 > > protected members of the class. Any volunteers to create
 > > and contribute a MemberAccessor class the JDEE?
 > > 
 > > Paul
 > 
 > > 
 > 
 > 
 > -- 
 > I am, truly and sincerely,
 > your friend and well-wisher,
 > 
 > 
 > 
 > m0smith
 > http://www.topoged.com

Reply via email to