use of com.developmentontheedge.beans.DynamicPropertySet in project be5 by DevelopmentOnTheEdge.
the class DynamicPropertySetMetaClass method setProperty.
@Override
@SuppressWarnings("unchecked")
public void setProperty(Object object, String propertyName, Object value) {
DynamicPropertySet dps = ((T) object);
if (value instanceof Map) {
Map map = (Map) value;
map.put("name", propertyName);
this.invokeMethod(object, "leftShift", new Object[] { map });
return;
}
if (value == null) {
DynamicProperty dp = new DynamicProperty(propertyName, String.class);
dp.setValue(null);
dps.add(dp);
return;
}
if (dps.getProperty(propertyName) != null) {
dps.setValue(propertyName, value);
return;
}
DynamicProperty dp = new DynamicProperty(propertyName, value.getClass());
dp.setValue(value);
dps.add(dp);
}
use of com.developmentontheedge.beans.DynamicPropertySet in project be5 by DevelopmentOnTheEdge.
the class TestOperation method getParameters.
@Override
public Object getParameters(Map<String, Object> presetValues) throws Exception {
DynamicPropertySet dps = new DynamicPropertySetSupport();
dps.add(new DynamicProperty("name", "Name", String.class, presetValues.getOrDefault("name", "")));
dps.add(new DynamicProperty("number", "Number", Long.class, presetValues.getOrDefault("number", "0")));
return dps;
}
Aggregations