Return-Path: X-Original-To: apmail-groovy-users-archive@minotaur.apache.org Delivered-To: apmail-groovy-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8C10D18887 for ; Thu, 27 Aug 2015 04:20:28 +0000 (UTC) Received: (qmail 96345 invoked by uid 500); 27 Aug 2015 04:20:28 -0000 Delivered-To: apmail-groovy-users-archive@groovy.apache.org Received: (qmail 96288 invoked by uid 500); 27 Aug 2015 04:20:28 -0000 Mailing-List: contact users-help@groovy.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.incubator.apache.org Delivered-To: mailing list users@groovy.incubator.apache.org Received: (qmail 96278 invoked by uid 99); 27 Aug 2015 04:20:28 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Aug 2015 04:20:28 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id CFB051AAED9 for ; Thu, 27 Aug 2015 04:20:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.314 X-Spam-Level: ** X-Spam-Status: No, score=2.314 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id YhOulW9wyAUP for ; Thu, 27 Aug 2015 04:20:18 +0000 (UTC) Received: from mbob.nabble.com (mbob.nabble.com [162.253.133.15]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTP id A78F442B5D for ; Thu, 27 Aug 2015 04:20:18 +0000 (UTC) Received: from msam.nabble.com (unknown [162.253.133.85]) by mbob.nabble.com (Postfix) with ESMTP id 32D691417CDA for ; Wed, 26 Aug 2015 21:17:54 -0700 (PDT) Date: Wed, 26 Aug 2015 21:20:18 -0700 (MST) From: Rahul Somasunderam To: users@groovy.incubator.apache.org Message-ID: <1440649218336-5727308.post@n5.nabble.com> Subject: Object.use as an annotation MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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.