Details
-
Wish
-
Status: Reopened
-
Minor
-
Resolution: Unresolved
-
1.13.0
-
None
-
None
Description
public void updateName( @Parameter(defaultOf="Foo") // if can specify an Object??? @ParameterLayout(named = "New name") final String name) { setName(newName); }
or a more elaborate (over-complicated?) design:
eg:
public void updateName( @Parameter(defaultFrom=ParameterDefaultFromProperty.class @ParameterLayout(named = "New name") final String name) { setName(newName); }
where (part of the applib):
public interface ParameterDefaulter { Object defaultFor(Object domainObject, String actionName, String parameterName); }
and the applib also provides a default implementation:
public class ParameterDefaultFromProperty implements ParametedDefaulter { ... }
that uses an injected service (from core.runtime) to look up the parameter value from the corresponding property of the object.