Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-1056

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

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • core-1.8.0
    • 2.0.0-M1
    • Core
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: