1 15 package org.apache.tapestry; 16 17 import org.apache.hivemind.ApplicationRuntimeException; 18 19 29 30 public class StaleLinkException extends ApplicationRuntimeException 31 { 32 private transient IPage _page; 33 private String _pageName; 34 private String _targetIdPath; 35 private String _targetActionId; 36 37 public StaleLinkException() 38 { 39 super(null, null, null, null); 40 } 41 42 47 48 public StaleLinkException(IComponent component, String targetActionId, String targetIdPath) 49 { 50 super( 51 Tapestry.format( 52 "StaleLinkException.action-mismatch", 53 new String [] { targetActionId, component.getIdPath(), targetIdPath }), 54 component, 55 null, 56 null); 57 58 _page = component.getPage(); 59 _pageName = _page.getPageName(); 60 61 _targetActionId = targetActionId; 62 _targetIdPath = targetIdPath; 63 } 64 65 69 70 public StaleLinkException(IPage page, String targetActionId, String targetIdPath) 71 { 72 this( 73 Tapestry.format( 74 "StaleLinkException.component-mismatch", 75 targetActionId, 76 targetIdPath), 77 page); 78 79 _targetActionId = targetActionId; 80 _targetIdPath = targetIdPath; 81 } 82 83 public StaleLinkException(String message, IComponent component) 84 { 85 super(message, component, null, null); 86 } 87 88 89 90 public String getPageName() 91 { 92 return _pageName; 93 } 94 95 100 101 public IPage getPage() 102 { 103 return _page; 104 } 105 106 public String getTargetActionId() 107 { 108 return _targetActionId; 109 } 110 111 public String getTargetIdPath() 112 { 113 return _targetIdPath; 114 } 115 116 } | Popular Tags |