I tried to change the test case to the following;

    public interface Nameable
    {
        CapitalizedProperty name();
    }

    @Concerns( CapitalizeConcern.class )
    public interface CapitalizedProperty extends Property<String>
    {
        @Capitalized
        void set( String newValue )
            throws IllegalArgumentException, IllegalStateException;
    }

But now something else kicks in. In the
AbstractPropertyModel.PropertyHandler#invoke, the logic is

     return method.invoke( p, args );

where p is the PropertyInstance assigned as the backer. AND
PropertyInstance.set(T) and CapitalizedProperty.set(String) are not
matching methods, an Exception occurs.

Then I thought; Wait a second, I don't need the annotation;

    public interface Nameable
    {
        CapitalizedProperty name();
    }

    @Concerns( CapitalizeConcern.class )
    public interface CapitalizedProperty extends Property<String>
    {
    }

Now there are no runtime exceptions, just that the concern is not invoked.



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