use of org.btrplace.model.view.ModelView in project scheduler by btrplace.
the class ModelConverter method toJSON.
@Override
public JSONObject toJSON(Model i) throws JSONConverterException {
JSONArray rcs = new JSONArray();
for (ModelView v : i.getViews()) {
rcs.add(viewsConverter.toJSON(v));
}
JSONObject o = new JSONObject();
o.put(MAPPING_LABEL, toJSON(i.getMapping()));
o.put(ATTRS_LABEL, AttributesConverter.toJSON(i.getAttributes()));
o.put(VIEWS_LABEL, rcs);
return o;
}
Aggregations