Annotation x Dependency Injection

Hi,

Is there a way to inject an object in a pojo through annotation? Like Spring does.

Example

@exceptionProcessor MyExceptionProcessor

public class MyClass implements ExceptionHandler {

private ExceptionProcessor exceptionProcessor;

public void setExceptionProcessor(ExceptionProcessor exceptionProcessor) {

...

}

public ExceptionProcessor getExceptionProcessor( ) {

...

}

}

Thanks,

George

[481 byte] By [gmaggessa] at [2007-9-25]
# 1

> Hi,

>

> Is there a way to inject an object in a pojo through

> annotation? Like Spring does.

[snip]

It is not clear to me what you want to do. A class can reflectively read annotations at runtime, including its own annotations, and act accordingly. Otherwise, annotation processing can be used to generate code at build time; the superclass of a class can be generated as well as subclasses of a class.

j.d.darcya at 2007-7-14 > top of java,Core,Core APIs...