00001 package net.threebit.utils.sosc; 00002 00003 /* 00004 Copyright 2003 Shawn Deleurme 00005 Copyright 2003 Kevin O'Donnell 00006 00007 This program is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 */ 00021 00022 import java.io.*; 00023 import java.util.*; 00024 import java.util.logging.*; 00025 00030 public class JavaTool { 00031 00035 public static Object newInstance (String className) throws Exception { 00036 try { 00037 return Class.forName(className).getConstructor(null).newInstance(null); 00038 } 00039 catch (Exception e) { 00040 Exception ee = new Exception("Error creating new instance of class '"+className+"'",e); 00041 throw(ee); 00042 } 00043 } 00044 00045 }
1.2.15