/jEdit/tags/jedit-4-1-pre5/bsh/commands/which.bsh
Unknown | 24 lines | 18 code | 6 blank | 0 comment | 0 complexity | a40a31e3f91fe73461a0e9f15e8c4e4b 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
- /**
- Use classpath mapping to determine the source of the specified class
- file. (Like the Unix which command for executables).
- @method which( classIdentifier | string | class )
- */
- bsh.help.which= "usage: which( classIdentifier | string | class )";
- import bsh.Name;
- import bsh.BshClassManager;
- which( clas ) {
- // make the class into a name
- if ( clas instanceof Name.ClassIdentifier )
- clas = this.namespace.identifierToClass( clas );
- if ( clas instanceof Class )
- clas = clas.getName();
- String className = clas;
- cp = BshClassManager.getClassManager().getClassPath();
- print ( cp.getClassSource( className ) );
- }