On Mar 14, 2006, at 20:37, [EMAIL PROTECTED] wrote:

Von: "Andreas L Delmelle"<[EMAIL PROTECTED]>

Anyway, you'd have to go:

Object o = property;
CompoundDatatype c = (CompoundDatatype) o;
No, you don't have to. The property would have a method 'getCompound ()' returning a CompoundDatatype. Either it returns this, 'cause it is a CompoundDatatype or it returns a previously set instance (constructor, set-method) or it creates an instance, if necessary (maybe with default types) or even returns 'null' 'cause it's not able to deal with CompoundDatatype. So the only thing you need is a null-check on abstract levels, not a cast or instanceof. It may return a non-null value which maybe this, maybe an attribute, maybe a Singleton, whatever...

OK. Now I see... Just like it is currently done with, for example, Property.getList(), Property.getEnum() etc. (Correct?)

Anyway, I thought about starting off with making that getObject() method protected. AFAICT, it's never used outside of the properties package, so in preparation for an eventual revision of this part of the code, it seems wise to reduce that method's visibility to indicate that it is meant for internal use only, so as not to encourage its use elsewhere.

WDYT?

Cheers,

Andreas

Reply via email to