1 26 package org.objectweb.util.explorer.resolver.lib; 27 28 import org.objectweb.util.explorer.api.Entry; 29 import org.objectweb.util.explorer.core.code.api.CodeDescription; 30 import org.objectweb.util.explorer.core.common.api.Description; 31 import org.objectweb.util.explorer.core.common.api.ExplorerConstants; 32 import org.objectweb.util.explorer.core.root.api.RootDescriptions; 33 import org.objectweb.util.explorer.core.root.lib.BasicRootDescriptions; 34 35 43 public class RootResolver 44 extends AbstractPropertyResolver 45 { 46 47 53 59 65 68 protected String getPropertyType() { 69 return ExplorerConstants.ROOT_PROPERTY; 70 } 71 72 77 protected CodeDescription getRootDesc(Object key){ 78 return (CodeDescription)getPropertyProvider().getPropertyDescription(getPropertyType(), key); 79 } 80 81 protected RootDescriptions getRootDescription(){ 82 RootDescriptions rootDesc = new BasicRootDescriptions(); 83 String [] roleIds = getRoleProvider().getInheritedRoleIds(getRoleManager().getCurrentRoleIds()); 84 for (int i = 0; i < roleIds.length; i++) { 85 CodeDescription codeDesc = getRootDesc(roleIds[i]); 86 if(codeDesc!=null && !codeDesc.isEmpty()){ 87 rootDesc.addRootDescription(codeDesc); 88 } 89 } 90 return rootDesc; 91 } 92 93 99 102 public Description resolve(String propertyType, Entry currentEntry, Entry parentEntry) { 103 return getRootDescription(); 104 } 105 106 109 public Description resolve(String propertyType, Entry currentEntry) { 110 return resolve(getPropertyType(), currentEntry, null); 111 } 112 113 } 114 | Popular Tags |