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 NameEndsWithCondition extends Condition { 41 42 43 private String suffix; 44 45 49 public void setSuffix(String suffix) { 50 this.suffix = suffix; 51 } 52 53 56 public boolean isAllowed(Object object, RuleContext context) throws TransformationException { 57 org.omg.uml.core.ModelElement element = (org.omg.uml.core.ModelElement) object; 58 return element.getName() != null && element.getName().endsWith(suffix); 59 } 60 61 } 62 | Popular Tags |