/* * Moonlight|3D Copyright (C) 2005 The Moonlight|3D team * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Created on Jan 21, 2005 */ package ml.core.scripts; /** * \package ml.core.scripts * * This is the management system for script interpreter plugins. * It is responsible for registering script interpreters and * providing interfaces through which scripts can be run * independently of the interpreter involved. In particular, * this package is also responsible for running startup scripts. * * This package is part of the core program. */ import java.io.File; import java.util.ArrayList; import java.util.List; import ml.core.State; import ml.core.exceptions.Exception; /** * This is the script manager. Each script language provider must register * with this manager. New Interpreter instances are created exclusively * through this class. * * @author gregor */ public class Manager { private ArrayList languages; public Manager() { languages=new ArrayList(); } /** * Register a script language. * * @param language the main interface for this language * @see Language */ public void registerLanguage(Language language) { languages.add(language); } /** * unegister a script language. * * @param name the name of the script language as given by its Language interface * @see Language */ public void unregisterLanguage(String name) throws Exception { for(int i=0;i getLanguages() { ArrayList languageNames=new ArrayList(); for(int i=0; i