Announcement Announcement Module
Collapse
No announcement yet.
Recognizing bean properties added by an AspectJ inter-type member declaration? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment

    Working...
    X