On Thu, Dec 17, 2009 at 3:47 PM, Rickard Öberg <[email protected]> wrote:
> On 2009-12-14 07.26, Niclas Hedhman wrote:
>>
>> Unfortunately, I can't find any discussion on this, and the
>> ModuleAssembly.forMixin( type ).setMetaInfo( info ), is not obvious
>> how it relates to Property metaInfo, and the code looks "suspicious"
>> to me.
>
> This part Michael Hunger wrote I think. I agree, it's not obvious how to do
> that part. Michael, any ideas?

I think it works like this;

public interface UserState
{
    Property<Date> created();
    Property<Date> modified();
}

module.forMixin( UserState.class ).setMetaInfo( someMeta
).declareDefaults().created();

And I can now retrieve that "someMeta" from

userState.created().metaInfo( typeOfSomeMeta );

If I don't call the setMetaInfo() before a new round of
declareDefaults(), the metaInfo will be null (therefor the set to null
question I had earlier). So, multiple declarations must be;

module.forMixin( UserState.class ).setMetaInfo( someMeta
).declareDefaults().created();

module.forMixin( UserState.class ).setMetaInfo( someOtherMeta
).declareDefaults().modified();


Need to get this documented...


Cheers
-- 
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to