/jEdit/tags/jedit-4-0-pre3/bsh/commands/javap.bsh
Unknown | 34 lines | 27 code | 7 blank | 0 comment | 0 complexity | b3414eecc7d966ee505cb4d8db270f18 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
- bsh.help.javap= "usage: javap( value )";
- import bsh.Name;
- javap( Object o ) {
- import java.lang.reflect.Modifier;
- if ( o instanceof Name.ClassIdentifier )
- clas = this.namespace.identifierToClass(o);
- if ( o instanceof String)
- clas = this.namespace.getClass((String)o);
- else if ( o instanceof Class )
- clas = o;
- else
- clas = o.getClass();
- methods=clas.getDeclaredMethods();
- //print("------------- Methods ----------------");
- for(int i=0; i<methods.length; i++) {
- m = methods[i];
- if ( Modifier.isPublic( m.getModifiers() ) )
- print( m );
- }
- //print("------------- Fields ----------------");
- fields=clas.getDeclaredFields();
- for(int i=0; i<fields.length; i++) {
- f = fields[i];
- if ( Modifier.isPublic( f.getModifiers() ) )
- print( f );
- }
- }