1 28 29 package org.objectweb.openccm.uml.transformation.modfact; 30 31 import ispuml.mdaTransformation.RuleContext; 32 import ispuml.mdaTransformation.TransformationException; 33 import ispuml.mdaTransformation.ActionBase; 34 import ispuml.mdaTransformation.rules.xml.CompositeXmlAction; 35 36 import javax.jmi.reflect.RefPackage; 37 import java.util.Collection ; 38 import java.util.Iterator ; 39 40 43 public class TransformJmiModelRootsAction extends CompositeXmlAction { 44 45 48 public TransformJmiModelRootsAction() { 49 isSrcPropertyRequired = false; 52 isDstPropertyRequired = false; 53 action = new TransformAction(); 54 } 55 56 59 class TransformAction extends ActionBase { 60 65 public Object execute(Object bean, RuleContext request) throws TransformationException { 66 Collection roots = JmiModFactModelCreateUtils.getRoots((RefPackage) bean); 67 Iterator iter = roots.iterator(); 68 69 if (!iter.hasNext()) 70 System.out.println(" Warning - no roots found for model '" + bean + "'"); 71 while (iter.hasNext()) { 72 Object cur = iter.next(); 73 request.engineContext.engine.transform(cur, request); 74 } 75 return null; 76 } 77 } } 79 | Popular Tags |