Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333681

Summary: Enhancement: Add XmlListeners (similar to JPA's EntityListeners)
Product: z_Archived Reporter: Blaise Doughan <blaise.doughan>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: wolfgang.werner+eclipsebugs
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 333683    
Bug Blocks:    

Description Blaise Doughan CLA 2011-01-06 13:38:07 EST
The XmlListener provides a mechanism to have the lifecycle event methods on an external class.


   @XmlListeners({CustomerDebugListener.class, AnotherListener.class})
   public class Customer {
   }

   public class CustomerDebugListener {

      @XmlBeforeUnmarshal
      public void preUnmarshal(Unmarshaller, Object parent, Customer child);

      @XmlAfterUnmarshal
      public void postUnmarshal(Unmarshaller, Object parent, Customer child);

      @XmlBeforeMarshal
      public boolean preMarshal(Marshaller, Customer child);
       
      @XmlAfterMarshal
      public void postMarshal(Marshaller, Customer child);

   }
Comment 1 Wolfgang Werner CLA 2011-12-14 10:16:39 EST
I'd very much like this to be implemented.

The current way of "just implementing a method with the correct signature" is not intuitive.
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:25:38 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink