Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6298503

RFE: "mandatory" or "required" annotation for bean properties

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      A DESCRIPTION OF THE REQUEST :
      Would it make sense to add "required" or "mandatory" annotation that can be used for "set" methods for JavaBeans to indicate that the property is required. This may or may not reflect in other JavaBeans interfaces.

      JUSTIFICATION :
      Frameworks such as Spring and JMX can benifit from such annotation and will reduce amount of initialization code. It will also allow to decouple the beans initialization from a specific framework by avoiding implementation of the initialization interfaces.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      class X {
        @Required
        public setDataSource(DataSource ds) {
          ...
        }
      }

      Framework (such as Spring), when instatntiating bean, can check if all required bean properties have been configured.
      ###@###.### 2005-07-19 00:10:59 GMT

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              malenkov Sergey Malenkov (Inactive)
              Reporter:
              gmanwanisunw Girish Manwani (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Imported:
                Indexed: