source: trunk/j/src/bsh/commands/reloadClasses.bsh @ 2

Last change on this file since 2 was 2, checked in by piso, 18 years ago

Initial checkin.

File size: 791 bytes
Line 
1
2bsh.help.reloadClasses=
3  "usage: reloadClasses( String class | String package | String [] classes )";
4
5import bsh.BshClassManager;
6import bsh.ClassPathException;
7
8/**
9  Reload specified set of classes
10*/
11reloadClasses( item )
12{
13  bcm = BshClassManager.getClassManager();
14
15  try {
16    if ( item instanceof String [] )
17      bcm.reloadClasses( item );
18    else {
19      name = item;
20
21      if ( name.endsWith(".*" ) ) {
22        if ( name.equals(".*" ) )
23          pack = "<unpackaged>";
24        else
25          pack = name.substring( 0, name.length()-2 );
26       
27        bcm.reloadPackage( pack );
28      } else
29        bcm.reloadClasses( new String[] { name } );
30    }
31  } catch ( ClassPathException e ) {
32    error( e.getMessage() );
33  }
34}
35
36/**
37  Reload all classes
38*/
39reloadClasses()
40{
41  BshClassManager.getClassManager().reloadAllClasses();
42}
Note: See TracBrowser for help on using the repository browser.