Reply To: Rewrite Annotations

Splash Forums Rewrite Users Rewrite Annotations Reply To: Rewrite Annotations


Hey Oleg,

You can do this, but you’d probably need to implement your own Annotation handlers, since at the moment we don’t support REST-style annotations.

However, if you look in our showcase, you can see how I’ve implemented this using the Rewrite Configuration itself:

We could probably add a few annotations to make this easier, but I have to ask, why not just use the JAX-RS specification from Java EE? RESTEasy is really quite nice to use!

This is actually very easy to do, even in your own code; all you need to do is create a custom annotation, and implement an AnnotationHandler:

Once this is done, you register your annotation handler as a service and you’re done! You now have an annotation that will use Rewrite to add behavior to your classes!

This is the mechanism we use internally to create all annotations, and it’s also a public SPI that anyone can use for their own needs. The whole philosophy of Rewrite is to use the same APIs internally that users would use to extend the framework.

What do you think?

Does that help? Are your maybe interested in adding REST support to Rewrite?