Back to project page plus1-android-sdk.
The source code is released under:
Copyright (c) 2012, WapStart All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Red...
If you think the Android project plus1-android-sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package ru.wapstart.plus1.sdk; //from w w w .jav a2s . c o m import java.util.HashMap; import java.util.Map; class MraidCommandRegistry { private static Map<String, MraidCommandFactory> commandMap = new HashMap<String, MraidCommandFactory>(); static { commandMap.put("close", new MraidCommandFactory() { public MraidCommand create(Map<String, String> params, MraidView view) { return new MraidCommandClose(params, view); } }); commandMap.put("expand", new MraidCommandFactory() { public MraidCommand create(Map<String, String> params, MraidView view) { return new MraidCommandExpand(params, view); } }); commandMap.put("usecustomclose", new MraidCommandFactory() { public MraidCommand create(Map<String, String> params, MraidView view) { return new MraidCommandUseCustomClose(params, view); } }); commandMap.put("open", new MraidCommandFactory() { public MraidCommand create(Map<String, String> params, MraidView view) { return new MraidCommandOpen(params, view); } }); } static MraidCommand createCommand(String string, Map<String, String> params, MraidView view) { MraidCommandFactory factory = commandMap.get(string); return (factory != null) ? factory.create(params, view) : null; } private interface MraidCommandFactory { public MraidCommand create(Map<String, String> params, MraidView view); } }