javap.bsh
来自「用java 编写的源码开放的文本编辑器。有很多有用的特性」· BSH 代码 · 共 47 行
BSH
47 行
/** Print the public fields and methods of the specified class (output similar to the JDK javap command). <p> If the argument is a string it is considered to be a class name. If the argument is an object, the class of the object is used. If the arg is a class, the class is used. @method void javap( String | Object | Class )*/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(); print( "Class "+clas+" extends " +clas.getSuperclass() ); 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 ); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?