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

(reflect) No method to scan for classes under a package

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0, 1.3.0
    • core-libs



      Name: mc57594 Date: 11/30/99


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

      The reflection capability in Java is missing one important element, the ability
      for an object to list out all the classes that it can access during runtime.
      Currently, if you don't know the name of the class, you can't access the
      class. What would be nice is that the Package class have a method that lists
      out the name of all its classes (in String format).

      This is my situation...
      I made an abstract CreditCard class upder a package called Payment that is the
      super class of all credit card types (eg.. Visa, Mastercard, etc) What I want
      to do is for the CreditCardClass to scan the Payment Package, and tell me all
      the classes in that package. Then armed with a list of class names then I can
      test each class to see if they are subclassed from CreditCard. This is done so
      that the class CreditCard won't have to be modified when a new credit card is
      written and placed in the Package.
      (Review ID: 98462)
      ======================================================================

            iris Iris Clark
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: