View Javadoc
1   package fr.paris.lutece.plugins.aot.modules.declarationimmat.utils;
2   
3   import javax.xml.bind.annotation.adapters.XmlAdapter;
4   
5   import fr.paris.lutece.plugins.aot.modules.declarationimmat.business.TypeVehicle;
6   
7   public class TypeVehicleAdapter extends XmlAdapter<String, TypeVehicle>
8   {
9   
10      @Override
11      public String marshal( TypeVehicle typeVehicle ) throws Exception
12      {
13          if ( null == typeVehicle )
14          {
15              return null;
16          }
17          return typeVehicle.getCode( );
18      }
19  
20      @Override
21      public TypeVehicle unmarshal( String code ) throws Exception
22      {
23          if ( null == code )
24          {
25              return null;
26          }
27          return TypeVehicle.fromCode( code );
28      }
29  
30  }