Results 1 to 2 of 2

Thread: Recognizing bean properties added by an AspectJ inter-type member declaration?

  1. #1
    Join Date
    Mar 2007
    Posts
    4

    Default Recognizing bean properties added by an AspectJ inter-type member declaration?

    I'm using AspectJ to provide a default interface implementation with inter-type member declarations. SpringIDE thinks there is an error in a spring xml config file where bean properties that have been added by the aspect are set.

    For example, class A implements B. The aspect declares a setFoo method on B, which A picks up because it implements B. A bean definition in xml for an object of type A causes a SpringIDE error for the property foo.

    <bean class="A">
    <property name="foo" value="bar" /> <!-- SpringIDE error -->
    </bean

    Is supporting this case out of scope for the SpringIDE project? If so it would be nice to be able to control whether this situation is treated as a error, warning or ignored, just like you can do with java compiler for certain things in java source files.

  2. #2
    Join Date
    Aug 2004
    Location
    Duesseldorf, Germany
    Posts
    1,210

    Default

    Hi,

    Is supporting this case out of scope for the SpringIDE project?
    This sounds like a very advanced usage of Dependency Injection and AOP. Anyway, currently there is no way of knowing for Spring IDE that there will be inter-type declarations as these do not exist in Eclipse's Java Model.

    Maybe there is a way to query that information from AJDT. I will explore this.

    In the meantime you can disable the validation rule "Bean Property Rule" from the project's perferences (Properties -> Spring -> Project Validators -> Beans Validator).

    HTH

    Christian
    Christian Dupuis
    SpringSource, a division of VMware
    Lead, SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/cdupuis

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •