/** Clear all cached classes and names */ public void classLoaderChanged() { nameSpaceChanged(); }
/** Clear all cached classes and names. */ public void classLoaderChanged() { this.nameSpaceChanged(); }
/** Remove the variable from the namespace. */ public void unsetVariable( String name ) { if ( variables != null ) { variables.remove( name ); nameSpaceChanged(); } }
/** Remove the variable from the namespace. * @param name the name */ public void unsetVariable(final String name) { this.variables.remove(name); this.nameSpaceChanged(); }
/** subsequent imports override earlier ones. * @param name the name */ public void importPackage(final String name) { this.importedPackages.remove(name); this.importedPackages.add(0, name); this.nameSpaceChanged(); }
/** Import a compiled Java object's methods and variables into this * namespace. When no scripted method / command or variable is found locally * in this namespace method / fields of the object will be checked. Objects * are checked in the order of import with later imports taking precedence. * <p/> * @param obj the obj Note: this impor pattern is becoming common... could * factor it out into an importedObject List<String> class. */ public void importObject(final Object obj) { this.importedObjects.remove(obj); this.importedObjects.add(0, obj); this.nameSpaceChanged(); }
/** Import static. * @param clas the clas */ public void importStatic(final Class<?> clas) { this.importedStatic.remove(clas); this.importedStatic.add(0, clas); this.nameSpaceChanged(); }
/** subsequent imports override earlier ones */ public void importPackage(String name) { if(importedPackages == null) importedPackages = new ArrayList<String>(); // If it exists, remove it and add it at the end (avoid memory leak) importedPackages.remove( name ); importedPackages.add(name); nameSpaceChanged(); }
/** */ public void importStatic( Class clas ) { if ( importedStatic == null ) importedStatic = new ArrayList<Class>(); // If it exists, remove it and add it at the end (avoid memory leak) importedStatic.remove( clas ); importedStatic.add( clas ); nameSpaceChanged(); }
/** Import a class name. Subsequent imports override earlier ones */ public void importClass(String name) { if ( importedClasses == null ) importedClasses = new HashMap<String,String>(); importedClasses.put( Name.suffix(name, 1), name ); nameSpaceChanged(); }
/** Import a compiled Java object's methods and variables into this namespace. When no scripted method / command or variable is found locally in this namespace method / fields of the object will be checked. Objects are checked in the order of import with later imports taking precedence. <p/> */ /* Note: this impor pattern is becoming common... could factor it out into an importedObject Vector class. */ public void importObject( Object obj ) { if ( importedObjects == null ) importedObjects = new ArrayList<Object>(); // If it exists, remove it and add it at the end (avoid memory leak) importedObjects.remove( obj ); importedObjects.add( obj ); nameSpaceChanged(); }
/** Import a class name. Subsequent imports override earlier ones * @param name the name */ public void importClass(final String name) { this.importedClasses.put(Name.suffix(name, 1), name); this.nameSpaceChanged(); }
/** Import scripted or compiled BeanShell commands in the following package * in the classpath. You may use either "/" path or "." package notation. * e.g. importCommands("/bsh/commands") or importCommands("bsh.commands") * are equivalent. If a relative path style specifier is used then it is * made into an absolute path by prepending "/". * @param name the name */ public void importCommands(String name) { // dots to slashes name = name.replace('.', '/'); // absolute if (!name.startsWith("/")) name = "/" + name; // remove trailing (but preserve case of simple "/") if (name.length() > 1 && name.endsWith("/")) name = name.substring(0, name.length() - 1); this.importedCommands.remove(name); this.importedCommands.add(0, name); this.nameSpaceChanged(); }
/** Import scripted or compiled BeanShell commands in the following package in the classpath. You may use either "/" path or "." package notation. e.g. importCommands("/bsh/commands") or importCommands("bsh.commands") are equivalent. If a relative path style specifier is used then it is made into an absolute path by prepending "/". */ public void importCommands( String name ) { if ( importedCommands == null ) importedCommands = new ArrayList<String>(); // dots to slashes name = name.replace('.','/'); // absolute if ( !name.startsWith("/") ) name = "/"+name; // remove trailing (but preserve case of simple "/") if ( name.length() > 1 && name.endsWith("/") ) name = name.substring( 0, name.length()-1 ); // If it exists, remove it and add it at the end (avoid memory leak) importedCommands.remove( name ); importedCommands.add(name); nameSpaceChanged(); }
this.nameSpaceChanged(); return var;
varScope.variables.put(name, this.createVariable(name, value, null/* modifiers */)); this.nameSpaceChanged();