Custom Property Edtor

I know most of java beans are based on gui, but, now I want to

ask a question about property editor of a bean which is not

based on gui.

If I use Introspector to load my bean dynamically, is it possible

to set the property using a property editor by geting the setter

Method and calling aMethod.invoke() ?

Sorry for my poor English, if i don't make it very clear,

please point out. thanks.

[447 byte] By [SuperMMX] at [2007-9-26 3:42:33]
# 1
To edit property of the bean it does not matter visible orinvisible the bean. Sun provide very helpful tutorial about beans. http://developer.java.sun.com/developer/onlineTraining/
gussev at 2007-6-29 12:20:22 > top of Java-index,Desktop,Developing for the Desktop...
# 2
I have read the javabeans tutorial, But all the examples saythe property editor is used in design time, not runtime.
SuperMMX at 2007-6-29 12:20:22 > top of Java-index,Desktop,Developing for the Desktop...
# 3

Hi.

for example.

I have the variable : int value;

Accordind the javabean's specification it would be the property "value" with acess methods

public void setValue(int value){ this.value = value;}

public intgetValue(){ return value;}

Sun provides the int type property with the standart property editor for desine time.

But during the runtime you have the full acess at the property. You can get the value and set the value.

gussev at 2007-6-29 12:20:22 > top of Java-index,Desktop,Developing for the Desktop...
# 4

I know that. But I want to know that if the edtor will be used in

runtime using Instrospector class like some jsp containers.

I have read the source of Tomcat (a jsp container), it just

gets the setter method and calls aMethod.invoke(). I want

to know whether the PropertyEditor will be invoked by this way.

If the answer is no, that's ok, but, if the answer is yes, how can I

make it work? some code is very preciated.

Thank you.

SuperMMX at 2007-6-29 12:20:22 > top of Java-index,Desktop,Developing for the Desktop...
# 5
Hi,of course it is possible. But you must read the specification how to do it.
gussev at 2007-6-29 12:20:22 > top of Java-index,Desktop,Developing for the Desktop...
# 6
Thank you, I will try.Sorry for this late reply.
SuperMMX at 2007-6-29 12:20:22 > top of Java-index,Desktop,Developing for the Desktop...