PageRenderTime 3ms CodeModel.GetById 1ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1/**
 2	Use classpath mapping to determine the source of the specified class
 3	file.  (Like the Unix which command for executables).
 4
 5	@method which( classIdentifier | string | class )
 6*/
 7
 8bsh.help.which= "usage: which( classIdentifier | string | class )";
 9
10import bsh.Name;
11import bsh.BshClassManager;
12
13which( clas ) { 
14	// make the class into a name
15	if ( clas instanceof Name.ClassIdentifier )
16		clas = this.namespace.identifierToClass( clas );
17	if ( clas instanceof Class )
18		clas = clas.getName();
19	String className = clas;
20
21	cp = BshClassManager.getClassManager().getClassPath();
22	print ( cp.getClassSource( className ) );
23}
24