1 26 package org.objectweb.util.explorer.interpreter.lib; 27 28 import org.objectweb.fractal.api.NoSuchInterfaceException; 29 import org.objectweb.util.explorer.core.common.api.Description; 30 import org.objectweb.util.explorer.core.common.lib.BindingFeature; 31 import org.objectweb.util.explorer.interpreter.api.DescriptionInterpreter; 32 33 41 public class DescriptionInterpreterDispatcher 42 extends BindingFeature 43 implements DescriptionInterpreter 44 { 45 46 52 58 64 72 protected DescriptionInterpreter getDescriptionInterpreter(String itfSuffixe){ 73 try { 74 return (DescriptionInterpreter)lookupFc(DescriptionInterpreter.DESCRIPTION_INTERPRETER + "-collection-" + itfSuffixe); 75 } catch (NoSuchInterfaceException e) { 76 getTrace().info(DescriptionInterpreter.DESCRIPTION_INTERPRETER + "-collection-" + itfSuffixe + ": interface not found!"); 77 return null; 78 } 79 } 80 81 87 90 public String [] clientFc() { 91 return new String []{DescriptionInterpreter.DESCRIPTION_INTERPRETER + "-collection"}; 92 } 93 94 100 103 public Object interprete(Description description, Object params) { 104 if(description!=null){ 105 DescriptionInterpreter descriptionInterpreter = getDescriptionInterpreter(description.getDescriptionType()); 106 if (descriptionInterpreter!=null) 107 return descriptionInterpreter.interprete(description, params); 108 } 109 return null; 110 } 111 112 113 } 114 115 116 | Popular Tags |