1 26 27 package org.objectweb.util.browser.plugin.java.reflect; 28 29 import java.util.List ; 30 import java.util.Map ; 31 import java.util.Vector ; 32 33 import org.objectweb.util.browser.api.Context; 34 import org.objectweb.util.browser.api.Entry; 35 import org.objectweb.util.browser.api.Wrapper; 36 import org.objectweb.util.browser.core.naming.DefaultEntry; 37 import org.objectweb.util.browser.core.naming.DefaultName; 38 39 47 public class TreeInheritanceContext 48 implements Wrapper, Context { 49 50 56 57 protected TreeInheritance treeInheritance_; 58 59 60 protected static Map config_; 61 62 63 public static final String DEFAULT_CONFIG = "_default_config_"; 64 65 71 77 83 87 public Entry[] getEntries() { 88 List entryList = new Vector (); 89 Class class_ = treeInheritance_._getClass(); 90 Class superClass = class_.getSuperclass(); 91 if(superClass!=null){ 92 entryList.add(new DefaultEntry(superClass,new DefaultName(superClass.getName()),this)); 93 } 94 Class [] interfaces = class_.getInterfaces(); 95 for (int i = 0; i < interfaces.length; i++) { 96 entryList.add(new DefaultEntry(interfaces[i],new DefaultName(interfaces[i].getName()),this)); 97 } 98 return (Entry[])entryList.toArray(new Entry[0]); 99 } 100 101 107 112 public void 113 setWrapped(Object object) { 114 treeInheritance_ = (TreeInheritance)object; 115 } 116 117 122 public Object 123 getWrapped() { 124 return treeInheritance_; 125 } 126 127 } | Popular Tags |