1 28 29 package org.objectweb.openccm.uml.transformation.rules.xml; 30 31 import ispuml.mdaTransformation.RuleContext; 32 import ispuml.mdaTransformation.TransformationException; 33 import ispuml.mdaTransformation.rules.xml.Condition; 34 35 40 public class MethodNotPresentCondition extends Condition { 41 42 43 private String methodName; 44 45 49 public void setMethodName(String methodName) { 50 this.methodName = methodName; 51 } 52 53 56 public boolean isAllowed(Object object, RuleContext context) throws TransformationException { 57 org.omg.uml.core.Classifier classifier = (org.omg.uml.core.Classifier)object; 58 java.util.List features = classifier.getFeature(); 59 java.util.Iterator it = features.iterator(); 60 while (it.hasNext()) { 61 Object feature = it.next(); 62 if (feature instanceof org.omg.uml.core.Method 63 && ((org.omg.uml.core.Method)feature).getSpecification().getName().equals(this.methodName)) 64 return false; 65 } 66 return true; 67 } 68 69 } 70 | Popular Tags |