The Source for Java Technology Collaboration
User: Password:



Start New Message Delete Post a Reply

Article: 
 Reflection in Action
Subject:  Great article!
Date:  2008-04-16 13:35:23
From:  roymayr


One question...
how can i set "null" a single parameter of method using reflection?

For example:

I've next method XXX:
public void XXX (Set foo) {
this.foo = foo;
}

I need send a null value to "foo" atribute, but i can't to use invoke(obj,null) because in this case, don't find method XXX() (without parameter)!! and trow java.lang.NoSuchMethodException...

any suggestion?

 Feed java.net RSS Feeds