1 26 27 package org.objectweb.util.browser.core.info; 28 29 import org.objectweb.util.browser.api.Info; 30 import org.objectweb.util.browser.core.api.InfoFactory; 31 32 40 public class DefaultInfoFactory 41 implements InfoFactory { 42 43 49 50 protected Class class_ = null; 51 52 58 64 70 71 public Info newInfo(Object object) { 72 if (class_ != null) { 73 try { 74 return (Info) class_.newInstance(); 75 } catch (java.lang.InstantiationException e) { 76 System.out.println(class_.getName() + " : Instanciation exception"); 77 } catch (java.lang.IllegalAccessException e) { 78 System.out.println(class_.getName() + " : Illegal access exception"); 79 } 80 } 81 return null; 82 } 83 84 public void setClassName(Class theClass) { 85 class_ = theClass; 86 } 87 88 } 89 90 91 | Popular Tags |