commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack, Paul" <pj...@sfaf.org>
Subject RE: [lang] Reflection utils [was: 1.0 release foci]
Date Wed, 14 Aug 2002 17:01:20 GMT
> the first 4 functions are exception protecting ones. Nothing fancy
> underneath, except for hasClass which is merely a nicer way of seeing if a
> class can be loaded.
>
> The next 3 all of functionality as it's not possible to do:
>
>Class bar =3D Foo.class;
>if(foo instanceof bar) {
>}
>
>at all.

Yes it is:

  Class bar = 3dFoo.class;
  if (bar.isInstance(foo)) {
  }

And implements() and extends() can both be implemented (much more quickly)
as:

  Class base = 3dFoo.class;
  Class intface = MyInterface.class;
  if (intface.isAssignableFrom(base)) {
  }

-Paul



> -----Original Message-----
> From: Henri Yandell [mailto:bayard@generationjava.com]
> Sent: Wednesday, August 14, 2002 9:57 AM
> To: Jakarta Commons Developers List
> Subject: RE: [lang] Reflection utils [was: 1.0 release foci]
> 
> 
> This message uses a character set that is not supported by 
> the Internet Service.  To view the original message content,  
> open the attached message. If the text doesn't display 
> correctly, save the attachment to disk, and then open it 
> using a viewer that can display the original character set. 
> 

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message