Skip to content

Instantly share code, notes, and snippets.

@gilleain
Created June 9, 2010 15:27
Show Gist options
  • Save gilleain/431640 to your computer and use it in GitHub Desktop.
Save gilleain/431640 to your computer and use it in GitHub Desktop.
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