You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Dan Haywood (JIRA)" <ji...@apache.org> on 2018/02/17 15:53:00 UTC
[jira] [Resolved] (ISIS-1056) [DUPLICATE] Support user-defined
annotations (as per Spring and JSR-303 etc).
[ https://issues.apache.org/jira/browse/ISIS-1056?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dan Haywood resolved ISIS-1056.
-------------------------------
Resolution: Duplicate
> [DUPLICATE] Support user-defined annotations (as per Spring and JSR-303 etc).
> -----------------------------------------------------------------------------
>
> Key: ISIS-1056
> URL: https://issues.apache.org/jira/browse/ISIS-1056
> Project: Isis
> Issue Type: New Feature
> Components: Core
> Affects Versions: core-1.8.0
> Reporter: Dan Haywood
> Priority: Major
> Fix For: 2.0.0-M1
>
>
> eg, instead of:
> @Action(semantics=SemanticsOf.SAFE)
> @ActionLayout(contributed=Contributed.AS_ASSOCIATION)
> @CollectionLayout(render=RenderType.EAGERLY)
> public List<Foo> someFoos() { ... }
> we could allow custom annotations like this to be defined:
> @Action(semantics=SemanticsOf.SAFE)
> @ActionLayout(contributed=Contributed.AS_ASSOCIATION)
> @CollectionLayout(render=RenderType.EAGERLY)
> public @interface ContributedCollection {
> }
> which would then allow:
> @ContributedCollection
> public List<Foo> someFoos() { ... }
> ~~~~
> This might also be a good way to support value types, eg by introducing a new ValueObject and ValueObjectLayout annotations:
> @ValueObject (
> mustSatisfy=MoneySpec.class,
> appliesTo={BigDecimal.class}
> )
> @ValueObjectLayout(
> named="Money"
> )
> public @interface Money {
> }
> and then:
> public void deposit(@Money BigDecimal bd) { ... }
> Behind the scenes, Isis would just be copying facets from the ObjectSpecification that represents the @Money annotation onto the parameter or property feature..
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)