de.dfki.util.xmlrpc.annotation
Annotation Type XmlRpcBean


@Documented
@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface XmlRpcBean

This annotation turns a normal java bean into a XML-RPC compliant type. Every property of the bean is automatically turned into a XML-RPC representation of type STRUCT without any extra line of code!!!

Property types can be of any XML-RPC compilant type, either by being a standard XML-RPC type, by being annotated with @XmlRpc, @XmlRpcBean or by being mapped to a converter through the @ConverterMappings annotation.

Example XmlRpcBeans:
 @XmlRpcBean
 public class BeanPot
 {
     private String mLabel;
     private Collection<CoffeeBean> mCoffeeBeans;
     
     public Collection<CoffeeBean> getCoffeeBeans()
     {
         return mCoffeeBeans;
     }
     public void setCoffeeBeans( Collection<CoffeeBean> coffeeBeans )
     {
         mCoffeeBeans = coffeeBeans;
     }
     
     public String getLabel()
     {
         return mLabel;
     }
     public void setLabel( String label )
     {
         mLabel = label;
     }
 [...]
 }
 
 @XmlRpcBean
 @ConverterMappings( @Mapping(type=URL.class,converter=URLConverter.class) )
 public class CoffeeBean
 {
     private String mType;
     private URL mOrigin;
     
     public URL getOrigin()
     {
         return mOrigin;
     }
     public void setOrigin( URL origin )
     {
         mOrigin = origin;
     }
     public String getType()
     {
         return mType;
     }
     public void setType( String type )
     {
         mType = type;
     }
 [...]    
  }
 



Copyright © 2012. All Rights Reserved.