Default Imports of selecteive Packages/Classes

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Default Imports of selecteive Packages/Classes

rameshj
Hi,

I require to add some default imports into my bsh console. I know, the command "import *;" will import all the classes into the CLI Console. Due to security reasons, I do not want to import all the classes. I require to import some selective classes/packages. I have tried to add imports in many ways in the getBshPrompt.bsh, but nothing is working except "import *;",

getBshPrompt()
{
    if( firstTime )
    {
       // Tried to import package, but not working
       this.namespace.importPackage("com.motorola.emh.core.cli.services");
   
                   (or)

       // Tried to import class directly, but not working
        this.namespace.importClass("com.motorola.emh.core.cli.services.CLI");
      
                   (or)

        //Tried to import packages directly, but not working
        import  
com.motorola.emh.core.cli.services.*;

                   (or)

        //Tried to import class directly, but not working
        import  
com.motorola.emh.core.cli.services.CLI;

                   (or)
          // It is working.
         import *;
        ...........
    }
}

Please help me on resolve the issue.

Thx,
Ramesh

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users