1 package com.teamkonzept.webman.mainint.events; 2 3 import java.util.*; 4 5 import com.teamkonzept.web.*; 6 import com.teamkonzept.lib.DatabaseErrorCodes; 7 import com.teamkonzept.lib.ErrorCodes; 8 import com.teamkonzept.lib.TKException; 9 import com.teamkonzept.webman.mainint.ContextConstants; 10 11 15 public abstract class DefaultEventHandler implements TKEventHandler, DatabaseErrorCodes, UserCodes, ContextConstants 16 { 17 18 public abstract void handleEvent(TKEvent evt) throws com.teamkonzept.lib.TKException; 19 20 public abstract boolean isHandler(TKEvent evt); 21 22 public void addEventHandler(TKEventHandler handler) 23 { 24 } 25 26 public void removeEventHandler(TKEventHandler handler) 27 { 28 } 29 30 31 public void setHandleEvents(TKEvent[] events) 32 {} 33 34 35 public TKEvent[] getHandleEvents() 36 { 37 return null; 38 } 39 40 46 public TKEvent createEvent (TKHttpInterface http) 47 { 48 return null; 49 } 50 51 59 public final void checkParameter (String value, String name) 60 throws TKException 61 { 62 if (value == null || 63 value.trim().length() == 0) 64 { 65 throw new TKUserException("The field '" + name + "' requires input.", 66 UserCodes.FIELD_VALUE_REQUIRED, 67 ErrorCodes.USER_SEVERITY, 68 true, 69 new Object []{name}, 70 null); 71 } 72 } 73 74 } 75 | Popular Tags |