• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: KVC and static methods (was Hairy Java related question)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: KVC and static methods (was Hairy Java related question)


  • Subject: Re: KVC and static methods (was Hairy Java related question)
  • From: petite_abeille <email@hidden>
  • Date: Sun, 26 Oct 2003 23:29:09 +0100

On Oct 26, 2003, at 22:51, Ben Trumbull wrote:

You can do an operation equivalent to instanceof without an object instance. java.lang.Class.isAssignableFrom()

Yep, you are absolutely right. But I would venture that Ray is not quiet there yet.


The reflection API is really quite easy to use. The only difficulty is the difference between java.lang.Class.getX() and getDeclaredX(). getX only returns public members. getDeclaredX returns any kind. Unfortunately, it's not that simple. getX returns inherited members, but getDeclaredX does not. So if you want to find all the protected methods on a Class, you need to loop through getDeclaredMethods all the way up the inheritance hierarchy.

One of those little gotchas which spice up those lonely winter nights...

By the way Ben, how do I "officially" extend KVC? This is something you might know ;)

Cheers,

PA.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: KVC and static methods (was Hairy Java related question) (From: Ray Ackland <email@hidden>)
 >Re: KVC and static methods (was Hairy Java related question) (From: Ben Trumbull <email@hidden>)
 >Re: KVC and static methods (was Hairy Java related question) (From: petite_abeille <email@hidden>)
 >Re: KVC and static methods (was Hairy Java related question) (From: Ben Trumbull <email@hidden>)

  • Prev by Date: Re: WO 5.2.2 update
  • Next by Date: Re: KVC and static methods
  • Previous by thread: Re: KVC and static methods (was Hairy Java related question)
  • Next by thread: Re: KVC and static methods (was Hairy Java related question)
  • Index(es):
    • Date
    • Thread