PageRenderTime 49ms CodeModel.GetById 20ms RepoModel.GetById 0ms 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
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
  1. bsh.help.javap= "usage: javap( value )";
  2. import bsh.Name;
  3. javap( Object o ) {
  4. import java.lang.reflect.Modifier;
  5. if ( o instanceof Name.ClassIdentifier )
  6. clas = this.namespace.identifierToClass(o);
  7. if ( o instanceof String)
  8. clas = this.namespace.getClass((String)o);
  9. else if ( o instanceof Class )
  10. clas = o;
  11. else
  12. clas = o.getClass();
  13. methods=clas.getDeclaredMethods();
  14. //print("------------- Methods ----------------");
  15. for(int i=0; i<methods.length; i++) {
  16. m = methods[i];
  17. if ( Modifier.isPublic( m.getModifiers() ) )
  18. print( m );
  19. }
  20. //print("------------- Fields ----------------");
  21. fields=clas.getDeclaredFields();
  22. for(int i=0; i<fields.length; i++) {
  23. f = fields[i];
  24. if ( Modifier.isPublic( f.getModifiers() ) )
  25. print( f );
  26. }
  27. }