|
Oh, my. This is so sweeeet. Imagine you can plug-in your annotation processor within javac. And then recompile the generated code. This is impressive.
The possibilities of this feature are immense. Take for instance EJB 3.0. You annotate your EJBs and your Web Services. Then some source code (remote interfaces, home interfaces, WSDL, etc.) is generated for you by annotation processors. And then this generated source code is compiled too.
For we enjoying Swing things may be easier, too. We may end up writing things like this:
@actionPerformed( ActionListener="myButtonActionPerformed" )
JButton myButton;
...
@ActionListener("myButtonActionPerformed")
private void whatever( ActionEvent actionEvent )
{
...
}
This, we could annotate listeners and then recursively generate new source files and class files, generating and adding anonymous action listeners at compile time.
Quite impressive, indeed. Now, don't you think annotations are the Next Big Thing in Java?
Cheers,
Antonio
|
Enviado por Jeffrey Olson en octubre 26, 2005 a las 07:27 PM CEST #
@actionPerformed( ActionListener=#whatever(ActionEvent) ) JButton myButton; ... private void whatever( ActionEvent actionEvent ) { ... }Enviado por Dmitri Colebatch en octubre 27, 2005 a las 01:10 AM CEST #
Enviado por R.J. en octubre 27, 2005 a las 05:14 AM CEST #
Enviado por Dmitri Colebatch en octubre 27, 2005 a las 05:46 AM CEST #