K
Kai Grossjohann
I skimmed the JavaBeans specification, but didn't read all of it. So
maybe I missed the important part. Feel free to just direct me to the
right spot...
I'm implementing a bean that has a list of items, at most one of which
is selected at any time. All instances of this class have two
standard items, but it is possible to add more items at runtime.
For my purpose, strings seem to be sufficient as items. So I have a
read/write property currentItem of type string which contains the
current item. I also have a read-only property none, where setting
currentItem to none means that none of the items is selected. Then I
have read-only properties one and two, where setting currentItem to
one or two means that this standard item is selected.
Of course, the read-only properties amount to methods getOne(),
getTwo(), and getNone() in the class. This seems weird. It's not
possible to see that these methods are really used as constants.
Is there a way to explicitly express in the JavaBeans convention that
there are constants ONE, TWO, and NONE, of type string that can be
used as the value of the property currentItem?
Kai
maybe I missed the important part. Feel free to just direct me to the
right spot...
I'm implementing a bean that has a list of items, at most one of which
is selected at any time. All instances of this class have two
standard items, but it is possible to add more items at runtime.
For my purpose, strings seem to be sufficient as items. So I have a
read/write property currentItem of type string which contains the
current item. I also have a read-only property none, where setting
currentItem to none means that none of the items is selected. Then I
have read-only properties one and two, where setting currentItem to
one or two means that this standard item is selected.
Of course, the read-only properties amount to methods getOne(),
getTwo(), and getNone() in the class. This seems weird. It's not
possible to see that these methods are really used as constants.
Is there a way to explicitly express in the JavaBeans convention that
there are constants ONE, TWO, and NONE, of type string that can be
used as the value of the property currentItem?
Kai