1 28 29 package org.objectweb.openccm.uml.transformation.ast; 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 37 40 public class ValueMemberVisibility extends CompositeXmlAction { 41 42 45 public ValueMemberVisibility() { 46 isSrcPropertyRequired = false; 49 isDstPropertyRequired = false; 50 action = new TransformAction(); 51 } 52 53 56 class TransformAction extends ActionBase { 57 63 public Object execute(Object bean, RuleContext request) throws TransformationException { 64 Object obj = request.getAttribute("visibility"); 65 org.omg.uml.datatypes.VisibilityKind visibility; 66 visibility = (org.omg.uml.datatypes.VisibilityKind)obj; 67 obj = request.getAttribute("declaration"); 68 org.objectweb.openccm.ast.api.ValueMemberDecl declaration; 69 declaration = (org.objectweb.openccm.ast.api.ValueMemberDecl) obj; 70 71 if (visibility.toString().equals("vk_public")) { 72 declaration.setPublic(); 73 } else if (visibility.toString().equals("vk_private")) { 74 declaration.setPrivate(); 75 } 76 return declaration; 77 } 78 79 } } 81 | Popular Tags |