1 28 29 package org.objectweb.util.explorer.parser.lib; 30 31 import org.objectweb.fractal.api.NoSuchInterfaceException; 32 import org.objectweb.util.explorer.core.common.api.ExplorerConstants; 33 import org.objectweb.util.explorer.core.common.lib.BindingFeature; 34 import org.objectweb.util.explorer.core.role.api.RoleProvider; 35 import org.objectweb.util.explorer.explorerConfig.Root; 36 import org.objectweb.util.explorer.explorerConfig.beans.ExplorerBean; 37 import org.objectweb.util.explorer.parser.api.ExplorerParser; 38 import org.objectweb.util.explorer.parser.api.RoleParser; 39 import org.objectweb.util.explorer.property.api.PropertyFeeder; 40 41 49 public class RootManager 50 extends BindingFeature 51 implements ExplorerParser, RoleParser 52 { 53 54 60 66 72 protected void parseRootElement(String roleId, Root root){ 73 if(root!=null && root.getCode()!=null){ 74 try { 75 ((PropertyFeeder)lookupFc(PropertyFeeder.PROPERTY_FEEDER)).feed(ExplorerConstants.ROOT_PROPERTY, roleId, ParserUtils.getCodeDescription(root.getCode())); 76 } catch (NoSuchInterfaceException e) { 77 e.printStackTrace(); 78 } 79 } 80 } 81 82 88 91 public String [] clientFc() { 92 return new String []{PropertyFeeder.PROPERTY_FEEDER}; 93 } 94 95 101 104 public void parseExplorer(ExplorerBean explorer) { 105 parseRootElement(RoleProvider.DEFAULT_ROLE, explorer.getRoot()); 106 } 107 108 114 117 public void parseRole(org.objectweb.util.explorer.explorerConfig.Role role) { 118 parseRootElement(role.getId(),role.getRoot()); 119 } 120 } 121 | Popular Tags |