1 26 27 package org.objectweb.util.browser.core.common; 28 29 import org.objectweb.util.browser.api.Context; 30 import org.objectweb.util.browser.api.Entry; 31 import org.objectweb.util.browser.core.api.RootFactory; 32 33 41 public class DefaultRootFactory 42 implements RootFactory 43 { 44 45 51 52 protected Class class_ = null; 53 54 60 66 72 73 78 public Entry[] newRootContext(){ 79 if (class_ != null) { 80 try { 81 Context c = (Context) class_.newInstance(); 82 return c.getEntries(); 83 } catch (java.lang.InstantiationException e) { 84 System.out.println(class_.getName() + " : Instanciation exception"); 85 } catch (java.lang.IllegalAccessException e) { 86 System.out.println(class_.getName() + " : Illegal access exception"); 87 } 88 } 89 return null; 90 } 91 92 97 public void setClassName(Class theClass) { 98 class_ = theClass; 99 } 100 101 } 102 103 104 | Popular Tags |