我有一个 JSON 映射,例如:
{ "element":"value","element2":"value2",...}
带有键和值字符串。我尝试用 autobean 阅读它,但我得到了奇怪的例外。它应该是直截了当的,不是吗?
我得到的错误是:
[ERROR] [project_name] - The java.util.Map parameterization is not simple, but the getConf method does not provide a delegate
我是这样读地图的:
final String jsObject = GeneralContextNativeReader.read("globalConf");
GlobalConfFactory globalConfFactory = GWT.create(GlobalConfFactory.class);
Map<String, String> globalConf = AutoBeanCodex.decode(globalConfFactory, Map.class, jsObject).as();
工厂定义为:
public interface GlobalConfFactory extends AutoBeanFactory {
AutoBean<Map<String, String>> globalConf();
}
那有什么问题?