1 package org.objectweb.fractal.julia; 2 3 import org.objectweb.fractal.api.Component; 4 import org.objectweb.fractal.api.NoSuchInterfaceException; 5 import org.objectweb.fractal.api.control.NameController; 6 import org.objectweb.fractal.api.control.SuperController; 7 8 11 12 public class Util { 13 14 private Util () { 15 } 16 17 23 24 public static void toString ( 25 final Component component, 26 final StringBuffer buf) 27 { 28 try { 29 NameController nc = 30 (NameController)component.getFcInterface("name-controller"); 31 try { 32 SuperController sc = 33 (SuperController)component.getFcInterface("super-controller"); 34 Component[] superComponents = sc.getFcSuperComponents(); 35 if (superComponents.length > 0) { 36 toString(superComponents[0], buf); 37 } 38 } catch (NoSuchInterfaceException ignored) { 39 } 40 buf.append('/'); 41 buf.append(nc.getFcName()); 42 } catch (NoSuchInterfaceException e) { 43 buf.append(component.toString()); 44 return; 45 } 46 } 47 } 48 | Popular Tags |