• 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
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: KVC and static methods


  • Subject: Re: KVC and static methods
  • From: Ray Ackland <email@hidden>
  • Date: Mon, 27 Oct 2003 11:05:29 +1300

From: petite_abeille <email@hidden>
Subject: Re: KVC and static methods (was Hairy Java related question)
Date: Sat, 25 Oct 2003 11:57:12 +0200
To: email@hidden

Yes. You will not need to cast anything. For example:

aClass = Class.forName( aClassName );
aMethod = aClass.getDeclaredMethod( "aMethodName", new Class[] {} );
aValue = aMethod.invoke( aClass, new Object[] {} );

This stuff is new to me and so had been trying it the wrong way. Have been reading up on it though, and will try giving this way a go.


Yeah, from what I had been reading it looked like I would have needed
to instantiate a dummy object just to get the info.

To get the info about what? The interface? You can use reflection for that too:

aClass.getInterfaces();

Was meaning turning them into instance methods and creating a dummy instance to call them on. Bit of a clumsy workaround, but academic now using the invoke stuff.


thanks for the help,

Ray.
_______________________________________________
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
      • From: petite_abeille <email@hidden>
  • Prev by Date: Re: KVC and static methods (was Hairy Java related question)
  • Next by Date: Re: WO 5.2.2 update
  • Previous by thread: Re: WO 5.2.2 update
  • Next by thread: Re: KVC and static methods
  • Index(es):
    • Date
    • Thread