1 22 package org.jboss.util.propertyeditor; 23 24 import org.jboss.util.NestedRuntimeException; 25 26 32 public class ClassEditor extends TextPropertyEditorSupport 33 { 34 41 public Object getValue() 42 { 43 try 44 { 45 ClassLoader loader = Thread.currentThread().getContextClassLoader(); 46 String classname = getAsText(); 47 Class type = loader.loadClass(classname); 48 49 return type; 50 } 51 catch (Exception e) 52 { 53 throw new NestedRuntimeException(e); 54 } 55 } 56 } 57 | Popular Tags |