[ 
https://issues.apache.org/jira/browse/ISIS-1484?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andi Huber updated ISIS-1484:
-----------------------------
    Summary: [Wish] Extend @Parameter, specify a class to obtain the default, 
choices, autoComplete.   (was: Extend @Parameter, specify a class to obtain the 
default, choices, autoComplete. )

> [Wish] Extend @Parameter, specify a class to obtain the default, choices, 
> autoComplete. 
> ----------------------------------------------------------------------------------------
>
>                 Key: ISIS-1484
>                 URL: https://issues.apache.org/jira/browse/ISIS-1484
>             Project: Isis
>          Issue Type: Wish
>          Components: Isis Applib (programming model)
>    Affects Versions: 1.13.0
>            Reporter: Daniel Keir Haywood
>            Priority: Minor
>
> {code}
> public void updateName(
>     @Parameter(defaultOf="Foo")  // if can specify an Object???
>     @ParameterLayout(named = "New name")
>     final String name) {
>     setName(newName);
> }
> {code}
> or a more elaborate (over-complicated?) design:
> eg:
> {code}
> public void updateName(
>     @Parameter(defaultFrom=ParameterDefaultFromProperty.class
>     @ParameterLayout(named = "New name")
>     final String name) {
>     setName(newName);
> }
> {code}
> where (part of the applib):
> {code}
> public interface ParameterDefaulter {
>     Object defaultFor(Object domainObject, String actionName, String 
> parameterName);
> } 
> {code}
> and the applib also provides a default implementation:
> {code}
> public class ParameterDefaultFromProperty implements ParametedDefaulter { ... 
> }
> {code}
> that uses an injected service (from core.runtime) to look up the parameter 
> value from the corresponding property of the object.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to