Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1933B9105 for ; Fri, 4 Nov 2011 09:55:24 +0000 (UTC) Received: (qmail 42580 invoked by uid 500); 4 Nov 2011 09:55:23 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 42476 invoked by uid 500); 4 Nov 2011 09:55:23 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 42468 invoked by uid 99); 4 Nov 2011 09:55:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2011 09:55:23 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [173.236.76.174] (HELO serv01.siteground309.com) (173.236.76.174) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2011 09:55:15 +0000 Received: from [86.184.131.207] (port=1179 helo=[192.168.1.64]) by serv01.siteground309.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1RMGUA-0001w2-Qh for dev@commons.apache.org; Fri, 04 Nov 2011 04:54:55 -0500 Message-ID: <4EB3C4AA.4050009@sandglass-software.com> Date: Fri, 04 Nov 2011 10:55:38 +0000 From: Adrian Crum Organization: Sandglass Software User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Commons Developers List Subject: Re: [convert] API Discussion... References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - serv01.siteground309.com X-AntiAbuse: Original Domain - commons.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - sandglass-software.com The source and target classes are used by the Converter.canConvert method. The Converter.canConvert method is used by the Converter factory to find the correct converter. The reason parameterized types are not used in this scenario is so you can create converters that handle entire class hierarchies. If you can think of a way to replace the Class references with parameters, that would be great. Submit a patch and I will look it over. You could submit a patch for your partially-completed ConverterChain class and maybe someone else will complete it. -Adrian On 11/4/2011 2:19 AM, James Carman wrote: > I was taking a look at the [convert] component because I have done > some work lately on some handy conversion classes. I'm struggling to > understand why you'd need the getSourceClass() and getTargetClass() > methods if you're using generics. > > > Also, I've got a class that looks like this: > > public class ConverterChain implements Converter > { > public static ConverterChain from(Class sourceType); > public ConverterChain append(Converter converter); > ... > } > > I'd like to contribute it, but in my library, I don't have all of > those references to the class objects (source/target). I might check > it in without the source/target stuff implemented. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org