return converter.fromModelNode(node);
}
}
Object fromSimpleModelNode(final ModelNode node) {
final TabularType tabularType = (TabularType)getOpenType();
final TabularDataSupport tabularData = new TabularDataSupport(tabularType);
final Map<String, ModelNode> values = new HashMap<String, ModelNode>();
final List<Property> properties = node.isDefined() ? node.asPropertyList() : null;
if (properties != null) {
for (Property prop : properties) {
values.put(prop.getName(), prop.getValue());
}
}
final TypeConverter converter = TypeConverter.getConverter(valueTypeNode, null);
for (Map.Entry<String, ModelNode> prop : values.entrySet()) {
Map<String, Object> rowData = new HashMap<String, Object>();
rowData.put("key", prop.getKey());
rowData.put("value", converter.fromModelNode(prop.getValue()));
try {
tabularData.put(new CompositeDataSupport(tabularType.getRowType(), rowData));
} catch (OpenDataException e) {
throw new RuntimeException(e);
}
}
return tabularData;