Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in PHP only
Search
Advanced Search
Forums
Product Launch
Updates
Today's Posts
Member List
Calendar
Home
Forum
Topic
PHP
methods of a class
Collapse
This topic is closed.
X
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
Jon Slaughter
#1
methods of a class
Jun 6 '07, 09:35 PM
is it possible to iterate through the methods in a class?
Thanks,
Jon
Rik
#2
Jun 6 '07, 09:55 PM
Re: methods of a class
On Wed, 06 Jun 2007 23:31:06 +0200, Jon Slaughter
<Jon_Slaughter@ Hotmail.comwrot e:
is it possible to iterate through the methods in a class?
PHP: get_class_methods - Manual
http://www.php.net/get_class_methods
Gets the class methods' names
Or use Reflection:
PHP: 404 Not Found
http://www.php.net/manual/en/language.oop5.reflection.php
PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.
--
Rik Wasmus
Comment
Post
Cancel
Carl
#3
Jun 6 '07, 10:15 PM
Re: methods of a class
"Jon Slaughter" <Jon_Slaughter@ Hotmail.comwrit es:
is it possible to iterate through the methods in a class?
>
Thanks,
Jon
If you want to see the public member methods you can do
something like this:
----8<----
package test;
import java.lang.refle ct.Method;
public class Test {
public static void main(String[] args)
throws ClassNotFoundEx ception {
Class c = Class.forName(" java.lang.refle ct.Method");
Method methods[] = c.getMethods();
for (Method m : methods) {
System.out.prin tln(m);
}
}
}
---->8----
Docs here:
http://java.sun.com/javase/6/docs/ap...ml#getMethods(
)
Hope that helps,
Carl.
Comment
Post
Cancel
Carl
#4
Jun 6 '07, 10:35 PM
Re: methods of a class
"Jon Slaughter" <Jon_Slaughter@ Hotmail.comwrit es:
is it possible to iterate through the methods in a class?
>
Thanks,
Jon
Doh!
That last reply was clearly posted to the wrong group.
Sorry,
Carl.
Comment
Post
Cancel
Jon Slaughter
#5
Jun 6 '07, 10:45 PM
Re: methods of a class
"Rik" <luiheidsgoeroe @hotmail.comwro te in message
news:op.ttir9um mqnv3q9@metalli um...
On Wed, 06 Jun 2007 23:31:06 +0200, Jon Slaughter
<Jon_Slaughter@ Hotmail.comwrot e:
>is it possible to iterate through the methods in a class?
>
PHP: get_class_methods - Manual
http://www.php.net/get_class_methods
Gets the class methods' names
>
Or use Reflection:
PHP: 404 Not Found
http://www.php.net/manual/en/language.oop5.reflection.php
PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.
>
--
Rik Wasmus
Thanks,
Jon
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment