home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2007 June
/
PCWorld_2007-06_cd.bin
/
multimedia
/
ppsee
/
PPSeeSetup.exe
/
lib
/
bsh-commands-2.0b4.jar
/
bsh
/
commands
/
reloadClasses.bsh
< prev
next >
Wrap
Text File
|
2005-05-23
|
1KB
|
56 lines
/**
Reload the specified class, package name, or all classes if no name is
given. e.g.
<p>
<pre>
reloadClasses();
reloadClasses("mypackage.*");
reloadClasses(".*") // reload unpackaged classes
reloadClasses("mypackage.MyClass")
</pre>
<p>
See "Class Path Management"
@method void reloadClasses( [ package name ] )
*/
bsh.help.reloadClasses=
"usage: reloadClasses( String class | String package | String [] classes )";
import bsh.ClassPathException;
void reloadClasses( item )
{
this.bcm = this.caller.namespace.getClassManager();
try {
if ( item instanceof String [] )
bcm.reloadClasses( item );
else {
this.name = item;
if ( name.endsWith(".*" ) ) {
if ( name.equals(".*" ) )
this.pack = "<unpackaged>";
else
this.pack = name.substring( 0, name.length()-2 );
bcm.reloadPackage( pack );
} else
bcm.reloadClasses( new String[] { name } );
}
} catch ( ClassPathException e ) {
error( e.getMessage() );
}
}
/**
Reload all classes
*/
void reloadClasses()
{
this.caller.namespace.getClassManager().reloadAllClasses();
}