Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class AdminDataQueryKeyLookup implements IAdminDataQueryKeyLookup {
- private var _queriesByType:Dictionary;
- public function AdminDataQueryKeyLookup () {
- configure();
- }
- //---------------------------------------
- // IAdminDataQueryKeyLookup Implementation
- //---------------------------------------
- public function getQueryKeyForDataType(dataType:Class):String
- {
- var query:String = _queriesByType[dataType];
- if(query == null)
- {
- var errorMessage:String = 'No query string was found for the dataType ' + dataType;
- throw(new ReferenceError(errorMessage));
- }
- return query;
- }
- private function configure():void
- {
- _queriesByType = new Dictionary();
- _queriesByType[AccountDataVO] = 'GET_ACCOUNT_ADMIN_DATA';
- _queriesByType[ServerDataVO] = 'GET_SERVER_ADMIN_DATA';
- _queriesByType[PluginDataVO] = 'GET_PLUGIN_ADMIN_DATA';
- _queriesByType[AdminPluginDataVO] = 'GET_ADMIN_PLUGIN_ADMIN_DATA';
- _queriesByType[UserDataVO] = 'LOCAL_GET_USER_ADMIN_DATA';
- }
- }
Add Comment
Please, Sign In to add comment