commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Waldrop <rlwald...@yahoo.com>
Subject Introspection help needed
Date Tue, 30 Jul 2002 20:36:19 GMT
Hi,
     I have a class with a static method that
I would like to call from BeanUtils.populate().  It
will not work.  I've traced through the source and the
problem is that PropertyUtils.getPropertyDescriptors()

returns a blank object inevitably causing
BeanUtils.setProperty(Object, String, Object) to
return before calling the bean set method.
     Apparently, I could create a BeanInfo object and
try to load it up, but would rather have this work
outright.  Does anyone know if I'm making a mistake
somewhere?

See similar source below.  setMessage() does not get
called for property "message".  setAppendMessage()
does
get called for property "appendMessage" .

Also, has anyone had any trouble using populate() on
final classes?

Thanks.

--bob w.

package configurator.tests;

public class Final{

	static String message = "HOWDY";

	public static void setMessage(String msg){
		message = msg;
	}

	public void setAppendMessage(String msg){
		message = message + msg;
	}

	public static void printMessage(){
		System.out.println("Messaging: " + message);
	}
}

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message