1 7 package com.inversoft.verge.mvc.controller.actionflow.config; 8 9 10 import com.inversoft.util.StringTools; 11 12 13 23 public class ActionLink extends BaseLink { 24 25 private String action; 26 27 28 32 public ActionLink(String action, Node origin, Node destination) { 33 34 super(origin, destination); 35 36 if (StringTools.isEmpty(action)) { 37 throw new IllegalArgumentException ("The action is invalid"); 38 } 39 40 this.action = action; 41 } 42 43 44 49 public String getAction() { 50 return action; 51 } 52 53 58 public String getValue() { 59 return action; 60 } 61 62 70 public boolean acceptAction(Object action) { 71 assert (action instanceof String ) : "action must be a String"; 72 assert (!StringTools.isEmpty((String ) action)) : "action can not be null or empty"; 73 74 return this.action.equals(action); 75 } 76 77 80 public String toString() { 81 StringBuffer buf = new StringBuffer (); 82 buf.append(getOrigin().getName()).append(" --(").append(action); 83 buf.append(")--> ").append(getDestination().getName()); 84 return buf.toString(); 85 } 86 } 87 | Popular Tags |