1 7 package com.inversoft.verge.mvc.controller.actionflow.config; 8 9 10 20 public class ExceptionLink extends BaseLink { 21 22 private Exception exception; 23 24 25 35 public ExceptionLink(Exception exception, Node origin, Node destination) { 36 super(origin, destination); 37 assert (exception != null) : "exception == null"; 38 this.exception = exception; 39 } 40 41 42 47 public Exception getException() { 48 return exception; 49 } 50 51 56 public String getValue() { 57 return exception.toString(); 58 } 59 60 69 public boolean acceptAction(Object action) { 70 assert (action != null) : "action == null"; 71 assert (action instanceof Exception ) : "action must be a String"; 72 73 return getClass().isAssignableFrom(action.getClass()); 74 } 75 76 79 public String toString() { 80 StringBuffer buf = new StringBuffer (); 81 buf.append(getOrigin().getName()).append(" --("); 82 buf.append(exception.getClass().getName()).append(")--> "); 83 buf.append(getDestination().getName()); 84 return buf.toString(); 85 } 86 } 87 88 | Popular Tags |