private Object build(JackObject jack) throws JackException { JackValueType type = jack.getType(); Object object = raj.createNew(type); for (Entry<JackObjectField, JackValue> entry : jack.getValues().entrySet()) { JackObjectField field = entry.getKey(); JackValue val = entry.getValue(); Object value = impl.convertToObject(val); raj.setValueTo(object, field, value); } return object; }
private JackObject evaluate(JackObjectDesign design, Object object) throws JackException { Map<JackObjectField, JackValue> values = new LinkedHashMap<>(); for (JackObjectField field : design.getFields()) { Object value = raj.getValueOf(object, field); JackValue jack = impl.convertToJack(value); values.put(field, jack); } JackValueType type = design.getType(); String description = tryToGetDescription(object); return new JackObject(type, values, description); }