JDK-6381469 : RFE: LTP: XMLEncoder, XMLDecoder should be able to use Apt
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 5.0,6
  • Priority: P5
  • Status: Open
  • Resolution: Unresolved
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-02-06
  • Updated: 2011-02-22
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
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.

Comments
EVALUATION The persistense delegate shoule be implemented in the @Bean annotation (JSR-273).
09-07-2008

EVALUATION The @Transient annotation is already implemented. See 4935607.
09-07-2008