Return-Path: X-Original-To: apmail-axis-java-dev-archive@www.apache.org Delivered-To: apmail-axis-java-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 CBFE69214 for ; Thu, 29 Sep 2011 11:23:42 +0000 (UTC) Received: (qmail 44062 invoked by uid 500); 29 Sep 2011 11:23:42 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 43893 invoked by uid 500); 29 Sep 2011 11:23:41 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 43883 invoked by uid 99); 29 Sep 2011 11:23:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Sep 2011 11:23:41 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sagara.gunathunga@gmail.com designates 209.85.216.180 as permitted sender) Received: from [209.85.216.180] (HELO mail-qy0-f180.google.com) (209.85.216.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Sep 2011 11:23:34 +0000 Received: by qyc1 with SMTP id 1so749032qyc.11 for ; Thu, 29 Sep 2011 04:23:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=tqGvMXfoO+LqLKFktXwR7B8/RQX8t7OrFAUI4AtTXUw=; b=sum+BoolRMi42vXXH5XUvyV89QaILjjACVCFTy7856SJgwzHBSFJyPayjFKw34B3oB FyqLXZ8QWKTbrfOUW+Z66pVmzivHYCT8Ni+lBwJypZo5AAhiRRt/ck9wY71qUmtVTYc7 LrGwUG5C0KzMzgQ7R98439doYdpxhCp2om6Cg= Received: by 10.224.216.70 with SMTP id hh6mr958889qab.145.1317295394145; Thu, 29 Sep 2011 04:23:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.85.138 with HTTP; Thu, 29 Sep 2011 04:22:54 -0700 (PDT) In-Reply-To: References: <20110927084505.A8A25238897D@eris.apache.org> From: Sagara Gunathunga Date: Thu, 29 Sep 2011 16:52:54 +0530 Message-ID: Subject: Re: svn commit: r1176281 - /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/TypeTable.java To: java-dev@axis.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Sep 29, 2011 at 12:54 AM, Andreas Veithen wrote: > That doesn't look like good OO design. XMLGregorianCalendar is an > abstract API and the actual runtime type is completely implementation > dependent. Trying to enumerate every possible existing implementation > is obviously not a correct approach. I would not be surprised if e.g. > on IBM WebSphere, that API is implemented by yet another class. Agree on you, in fact my original aim was to use instanceof operator to identify implementation class. BTW I have changed above method in r1177265. Thanks ! > > This probably points to a design flaw in the TypeTable thing. > > Andreas > > On Tue, Sep 27, 2011 at 10:45, =A0 wrote: >> Author: sagara >> Date: Tue Sep 27 08:45:05 2011 >> New Revision: 1176281 >> >> URL: http://svn.apache.org/viewvc?rev=3D1176281&view=3Drev >> Log: >> Since org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl is not an= instantiable class this method return null, changed to use Class names. >> >> Modified: >> =A0 =A0axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/de= scription/java2wsdl/TypeTable.java >> >> Modified: axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2= /description/java2wsdl/TypeTable.java >> URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/ker= nel/src/org/apache/axis2/description/java2wsdl/TypeTable.java?rev=3D1176281= &r1=3D1176280&r2=3D1176281&view=3Ddiff >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/descr= iption/java2wsdl/TypeTable.java (original) >> +++ axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/descr= iption/java2wsdl/TypeTable.java Tue Sep 27 08:45:05 2011 >> @@ -330,25 +330,18 @@ public class TypeTable { >> =A0 =A0 =A0* =A0 =A0 =A0 =A0 =A0 =A0the name >> =A0 =A0 =A0* @return the schema type name by class >> =A0 =A0 =A0*/ >> - =A0 =A0private QName getSchemaTypeNameByClass(String name) { >> - =A0 =A0 =A0 =A0Object dataClass; >> - =A0 =A0 =A0 =A0try { >> - =A0 =A0 =A0 =A0 =A0 =A0dataClass =3D Class.forName(name).newInstance()= ; >> - =A0 =A0 =A0 =A0 =A0 =A0/* >> - =A0 =A0 =A0 =A0 =A0 =A0 * XMLGregorianCalendar can be found as followi= ng classes. >> - =A0 =A0 =A0 =A0 =A0 =A0 * 1.)com.sun.org.apache.xerces.internal.jaxp.d= atatype.XMLGregorianCalendarImpl >> - =A0 =A0 =A0 =A0 =A0 =A0 * 2.)org.apache.xerces.jaxp.datatype.XMLGregor= ianCalendarImpl >> - =A0 =A0 =A0 =A0 =A0 =A0 */ >> - =A0 =A0 =A0 =A0 =A0 =A0if (dataClass instanceof XMLGregorianCalendar) = { >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (QName) simpleTypetoxsd.get(XMLG= regorianCalendar.class >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.getName()); >> - =A0 =A0 =A0 =A0 =A0 =A0} >> - =A0 =A0 =A0 =A0} catch (InstantiationException e) { >> - =A0 =A0 =A0 =A0 =A0 =A0e.printStackTrace(); >> - =A0 =A0 =A0 =A0} catch (IllegalAccessException e) { >> - =A0 =A0 =A0 =A0 =A0 =A0e.printStackTrace(); >> - =A0 =A0 =A0 =A0} catch (ClassNotFoundException e) { >> - =A0 =A0 =A0 =A0 =A0 =A0e.printStackTrace(); >> + =A0 =A0private QName getSchemaTypeNameByClass(String name) { >> + =A0 =A0 =A0 =A0/* >> + =A0 =A0 =A0 =A0 * XMLGregorianCalendar can be found as following class= es. >> + =A0 =A0 =A0 =A0 * 1.)com.sun.org.apache.xerces.internal.jaxp.datatype.= XMLGregorianCalendarImpl >> + =A0 =A0 =A0 =A0 * 2.)org.apache.xerces.jaxp.datatype.XMLGregorianCalen= darImpl >> + =A0 =A0 =A0 =A0 */ >> + =A0 =A0 =A0 =A0if ("com.sun.org.apache.xerces.internal.jaxp.datatype.X= MLGregorianCalendarImpl" >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.equals(name) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0|| "org.apache.xerces.jaxp.datatype.XML= GregorianCalendarImpl" >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.equals(name)) { >> + =A0 =A0 =A0 =A0 =A0 =A0return (QName) simpleTypetoxsd.get(XMLGregorian= Calendar.class >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.getName()); >> =A0 =A0 =A0 =A0 } >> =A0 =A0 =A0 =A0 return null; >> =A0 =A0 } >> >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org > For additional commands, e-mail: java-dev-help@axis.apache.org > > --=20 Sagara Gunathunga Blog =A0 =A0 =A0- http://ssagara.blogspot.com Web =A0 =A0 =A0- http://people.apache.org/~sagara/ LinkedIn - http://www.linkedin.com/in/ssagara --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org For additional commands, e-mail: java-dev-help@axis.apache.org