groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul Somasunderam <>
Subject Object.use as an annotation
Date Thu, 27 Aug 2015 04:20:18 GMT

Groovy allows you to create a `Category` class that can be later `use`d. A
great example is `TimeCategory` that makes dealing with time easy.

Also I see the `@Category` annotation that allows you to mark a class as a
category. However when it is time to `use` that category, you need to write

use (TimeCategory) {
  // some code

I was wondering was if there is an annotation I could apply to my method,
e.g. `@Use(TimeCategory)` to get the same effect.

Is there something in groovy that does that, or any library that already
does that?


View this message in context:
Sent from the Groovy Users mailing list archive at

View raw message