PageRenderTime 41ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Unknown | 19 lines | 15 code | 4 blank | 0 comment | 0 complexity | c407c0a9a23c0deec35db10f109ee322 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.which= "usage: which( classIdentifier | string | class )";
  2. import bsh.Name;
  3. import bsh.BshClassManager;
  4. /*
  5. */
  6. which( clas ) {
  7. // make the class into a name
  8. if ( clas instanceof Name.ClassIdentifier )
  9. clas = this.namespace.identifierToClass( clas );
  10. if ( clas instanceof Class )
  11. clas = clas.getName();
  12. String className = clas;
  13. cp = BshClassManager.getClassManager().getClassPath();
  14. print ( cp.getClassSource( className ) );
  15. }