• 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: Ben Trumbull <email@hidden>
  • Date: Sun, 26 Oct 2003 13:51:34 -0800

At 21:45 +0100 10/26/03, petite_abeille wrote:
I think he is referring to something like 'instanceof' which requires an object instance.

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


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.
--


-Ben
_______________________________________________
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.

  • Follow-Ups:
    • Re: KVC and static methods (was Hairy Java related question)
      • From: petite_abeille <email@hidden>
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>)

  • Prev by Date: Re: KVC and static methods (was Hairy Java related question)
  • 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