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

RFE: JavaBeans naming conventions for new indexed property methods

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.2.2
    • client-libs
    • generic
    • generic

      Name: sg39081 Date: 04/14/2000


      java version "1.2.2"
      Classic VM (build JDK-1.2.2-001, native threads, symcjit)

      The JavaBeans specification described naming conventions for two
      types of write methods for indexed properties:

        void setProperty(int index, PropertyType value);
        void setProperty(PropertyType values[]);

      It's very common that indexed properties are used to hold values that
      are added successively in JSP pages, for instance a property that
      holds items in a shopping cart where new items are added in separate
      requests. I therefore suggest adding a new type of setter method:

        void addProperty(PropertyType value);

      This method adds the new value at the next available index in
      the property.

      Methods to remove items of an indexed property would also be
      nice, e.g.:

        PropertyType removeProperty(PropertyType value);
           Returns the first occurance of value in the indexed property
           and removes it from the collection.

        PropertyType removeProperty(int index);
           Returns the specified indexed value and removes it from the
           collection.

      Removing a value like this would adjust the collection to fill
      the hole left by the removed value.
      (Review ID: 103682)
      ======================================================================

            malenkov Sergey Malenkov (Inactive)
            sgoodsunw Sheri Good (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: