Return-Path: Delivered-To: apmail-incubator-uima-user-archive@minotaur.apache.org Received: (qmail 42233 invoked from network); 29 Nov 2009 01:33:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Nov 2009 01:33:53 -0000 Received: (qmail 64244 invoked by uid 500); 29 Nov 2009 01:33:52 -0000 Delivered-To: apmail-incubator-uima-user-archive@incubator.apache.org Received: (qmail 64183 invoked by uid 500); 29 Nov 2009 01:33:52 -0000 Mailing-List: contact uima-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: uima-user@incubator.apache.org Delivered-To: mailing list uima-user@incubator.apache.org Received: (qmail 64173 invoked by uid 99); 29 Nov 2009 01:33:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Nov 2009 01:33:51 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of steven.bethard@gmail.com designates 209.85.160.41 as permitted sender) Received: from [209.85.160.41] (HELO mail-pw0-f41.google.com) (209.85.160.41) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Nov 2009 01:33:49 +0000 Received: by pwj1 with SMTP id 1so1624439pwj.20 for ; Sat, 28 Nov 2009 17:33:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=lW6X0YB4ACaFNK6gEggNs7XNL3tn6BDBtG/YOu7RZp4=; b=awqVb8YFGTF4Mz38yd657WNydxppzVr4HJAhw4gfiKPkBIIzCZe1GFfXEsjB2sPdGM y3MOXVCiLEePQHqlpFmdwc2sw3JTNY2N37eDE0vqZL9dBV1b/RRuxiPPTcpv7/3SaNJP BZM1Np1NwqK2EohcwYI7HM3y0QBmQRmqKJv4A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=CqXLUI/EU6SBsuA8ZrxSS18sAzmjMN8RmN5CDbh71ON16UzdLq+2OT34/ngxifpmu0 D3PDPe8lKWl2UOXROEivm58YIzfxlps95gYuOTyGlAJy7B+FEb0hc2pAYb3reYJ04ZZg qWgRA1OvIe+YAzpIPewxMj1lC1mi80cTf0xzw= MIME-Version: 1.0 Received: by 10.142.55.11 with SMTP id d11mr266784wfa.61.1259458409060; Sat, 28 Nov 2009 17:33:29 -0800 (PST) In-Reply-To: <72afa8bb0911280112u3a4e2757t1e12b69a072911d8@mail.gmail.com> References: <72afa8bb0911270747o4e571609jbe8c632e7695850d@mail.gmail.com> <4B0FF6C4.7050600@gmx.de> <72afa8bb0911280112u3a4e2757t1e12b69a072911d8@mail.gmail.com> Date: Sat, 28 Nov 2009 17:33:29 -0800 Message-ID: Subject: Re: Get annotation class from Type From: Steven Bethard To: uima-user@incubator.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, Nov 28, 2009 at 1:12 AM, Fabien POULARD wrot= e: > On Fri, Nov 27, 2009 at 4:56 PM, Thilo Goetz wrote: >> I guess this will work, as long as there even is a JCas type >> for the type you're looking for. =C2=A0There may not always be one, >> and we have this whole meta-programming kind of API for this >> kind of situation. =C2=A0If you tell us what you need the class for, >> we may be able to suggest alternative ways of handling this. > > My need is quite simple, a component I develop work on some types > passed to the component in parameter. I retrieve the type from its > name passed in parameter with a simple : > > Type mMonType =C2=A0=3D cas.getTypeSystem().getType(theParameterTypeStr); > > ... and I check it is not null before using it. > > Now I use some generic classes (java generics) for my processing and I > need to "configure" them with the class of the annotation > corresponding to this type. That's where I'm lost... If you know you're loading a Java class for a type, why not have your "theParameterTypeStr" be the fully qualified Java class name instead of the UIMA type? Then you can use the usual Java Class.forName() directly. Steve --=20 Where did you get that preposterous hypothesis? Did Steve tell you that? --- The Hiphopopotamus