Guest User

Untitled

a guest
May 4th, 2012
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. public function add(handlerType:Class):InstanceHandlerCollection {
  2. var handler:* = instanceClass(handlerType);
  3. var foundType:Boolean = false;
  4.  
  5. if (handler is BeforeInstanceHandler) {
  6. beforeHandlers.push(handler);
  7. foundType = true;
  8. }
  9.  
  10. if (handler is AfterInstanceHandler) {
  11. afterHandlers.push(handler);
  12. foundType = true;
  13. }
  14.  
  15. if (!foundType)
  16. throw new NotAnInstanceHandlerError(handlerType);
  17.  
  18. return this;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment