Created
June 9, 2010 15:27
-
-
Save gilleain/431640 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tmp; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Set; | |
public class BaseGenerator implements IGenerator { | |
public Map<String, Class> parameterTypes; | |
public Map<String, Object> defaultValues; | |
public BaseGenerator() { | |
parameterTypes = new HashMap<String, Class>(); | |
defaultValues = new HashMap<String, Object>(); | |
} | |
public void register(String parameter, Class type, Object defaultValue) { | |
parameterTypes.put(parameter, type); | |
defaultValues.put(parameter, defaultValue); | |
} | |
public Set<String> getParameterNames() { | |
return parameterTypes.keySet(); | |
} | |
public Object getParameterDefault(String parameterName) { | |
return defaultValues.get(parameterName); | |
} | |
public Class getParameterType(String parameterName) { | |
return parameterTypes.get(parameterName); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment