Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-1056

[DUPLICATE] Support user-defined annotations (as per Spring and JSR-303 etc).

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: core-1.8.0
    • Fix Version/s: 2.0.0-M1
    • Component/s: Isis Core
    • Labels:
      None

      Description

      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..

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              danhaywood Daniel Keir Haywood
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: