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

RFE: LTP: XMLEncoder, XMLDecoder should be able to use Apt

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • P5
    • None
    • 5.0, 6
    • client-libs
    • x86
    • windows_xp

    Description

      A DESCRIPTION OF THE REQUEST :
      At the moment if I want to use a custom DefaultPersistenceDelegate or make a field exposed by a bean transient for use with XMLEncoder and XMLDecoder, I need to create a BeanInfo and specify these things there. It would be much easier and more maintainable if I could specify these things using the new Apt tools introduced with Java 1.5.

      For example, I could write something like

      @PersistanceDelegateInfo(MyPersistanceDelegate.class)
      public class MyClass
      {
          int a;
          int b;

          public int getA() { return a; }
          public void setA(int a) { this.a = a; }

          public int getB() { return b; }
          @PDTransient public void setB(int b) { this.b = b; }
      }

      JUSTIFICATION :
      Using a BeanInfo is error prone. Whenever you alter your class, you need to rebuild your BeanInfo, which risks losing your settings. By using Apt and putting these things directly into the code, it is clearer and more maintainable.

      Attachments

        Issue Links

          Activity

            People

              malenkov Sergey Malenkov (Inactive)
              ndcosta Nelson Dcosta (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Imported:
                Indexed: