Guest User

Untitled

a guest
Jun 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. public class AdminDataQueryKeyLookup implements IAdminDataQueryKeyLookup {
  2.  
  3. private var _queriesByType:Dictionary;
  4.  
  5. public function AdminDataQueryKeyLookup () {
  6. configure();
  7. }
  8.  
  9. //---------------------------------------
  10. // IAdminDataQueryKeyLookup Implementation
  11. //---------------------------------------
  12.  
  13.  
  14. public function getQueryKeyForDataType(dataType:Class):String
  15. {
  16. var query:String = _queriesByType[dataType];
  17. if(query == null)
  18. {
  19. var errorMessage:String = 'No query string was found for the dataType ' + dataType;
  20. throw(new ReferenceError(errorMessage));
  21. }
  22. return query;
  23. }
  24.  
  25.  
  26. private function configure():void
  27. {
  28. _queriesByType = new Dictionary();
  29. _queriesByType[AccountDataVO] = 'GET_ACCOUNT_ADMIN_DATA';
  30. _queriesByType[ServerDataVO] = 'GET_SERVER_ADMIN_DATA';
  31. _queriesByType[PluginDataVO] = 'GET_PLUGIN_ADMIN_DATA';
  32. _queriesByType[AdminPluginDataVO] = 'GET_ADMIN_PLUGIN_ADMIN_DATA';
  33. _queriesByType[UserDataVO] = 'LOCAL_GET_USER_ADMIN_DATA';
  34. }
  35.  
  36. }
Add Comment
Please, Sign In to add comment