Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 0.68 KB  |  hits: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to expose a Java interface type through jax-rs
  2. @XmlRootElement
  3. @JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
  4. @Data
  5. public class SomeObject implements Serializable {
  6.  
  7. private static final long serialVersionUID = -3711391025272861884L;
  8.  
  9. private IInterface config;
  10.  
  11. @XmlElement
  12. public IInterface getConfig() {
  13.     return config;
  14. }
  15. }
  16.        
  17. @XmlRootElement
  18. @JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
  19. @Data
  20. public class SomeObject implements Serializable {
  21.  
  22.     private static final long serialVersionUID = -3711391025272861884L;
  23.  
  24.     private IInterface config;
  25.  
  26.     @XmlElement(type=IInterfaceImpl.class)
  27.     public IInterface getConfig() {
  28.         return config;
  29.     }
  30. }