PageRenderTime 34ms CodeModel.GetById 31ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-0-pre5/bsh/commands/javap.bsh

#
Unknown | 34 lines | 27 code | 7 blank | 0 comment | 0 complexity | b3414eecc7d966ee505cb4d8db270f18 MD5 | raw file
 1
 2bsh.help.javap= "usage: javap( value )";
 3
 4import bsh.Name;
 5javap( Object o ) {
 6	import java.lang.reflect.Modifier;
 7
 8
 9	if ( o instanceof Name.ClassIdentifier )
10		clas = this.namespace.identifierToClass(o);
11	if ( o instanceof String)
12		clas = this.namespace.getClass((String)o);
13	else if ( o instanceof Class )
14		clas = o;
15	else 
16		clas = o.getClass();
17
18	methods=clas.getDeclaredMethods();
19	//print("------------- Methods ----------------");
20	for(int i=0; i<methods.length; i++) {
21		m = methods[i];
22		if ( Modifier.isPublic( m.getModifiers() ) )
23			print( m );
24	}
25
26	//print("------------- Fields ----------------");
27	fields=clas.getDeclaredFields();
28	for(int i=0; i<fields.length; i++) {
29		f = fields[i];
30		if ( Modifier.isPublic( f.getModifiers() ) )
31			print( f );
32	}
33}
34