groovy-users mailing list archives

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

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?

R,
rahul



--
View this message in context: http://groovy.329449.n5.nabble.com/Object-use-as-an-annotation-tp5727308.html
Sent from the Groovy Users mailing list archive at Nabble.com.

Mime
View raw message