AbstractDeserializer.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */
  20. package org.openspcoop2.core.integrazione.utils.serializer;

  21. import org.openspcoop2.generic_project.exception.DeserializerException;

  22. import org.openspcoop2.core.integrazione.EsitoRichiesta;

  23. import java.io.InputStream;
  24. import java.io.File;

  25. /**    
  26.  * XML Deserializer of beans
  27.  *
  28.  * @author Poli Andrea (poli@link.it)
  29.  * @author $Author$
  30.  * @version $Rev$, $Date$
  31.  */

  32. public abstract class AbstractDeserializer extends org.openspcoop2.generic_project.serializer.AbstractDeserializerBase {



  33.     /*
  34.      =================================================================================
  35.      Object: esito-richiesta
  36.      =================================================================================
  37.     */
  38.    
  39.     /**
  40.      * Transform the xml in <var>fileName</var> in the object type {@link org.openspcoop2.core.integrazione.EsitoRichiesta}
  41.      *
  42.      * @param fileName Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.integrazione.EsitoRichiesta}
  43.      * @return Object type {@link org.openspcoop2.core.integrazione.EsitoRichiesta}
  44.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  45.      */
  46.     public EsitoRichiesta readEsitoRichiesta(String fileName) throws DeserializerException {
  47.         return (EsitoRichiesta) this.xmlToObj(fileName, EsitoRichiesta.class);
  48.     }
  49.    
  50.     /**
  51.      * Transform the xml in <var>file</var> in the object type {@link org.openspcoop2.core.integrazione.EsitoRichiesta}
  52.      *
  53.      * @param file Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.integrazione.EsitoRichiesta}
  54.      * @return Object type {@link org.openspcoop2.core.integrazione.EsitoRichiesta}
  55.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  56.      */
  57.     public EsitoRichiesta readEsitoRichiesta(File file) throws DeserializerException {
  58.         return (EsitoRichiesta) this.xmlToObj(file, EsitoRichiesta.class);
  59.     }
  60.    
  61.     /**
  62.      * Transform the input stream <var>in</var> in the object type {@link org.openspcoop2.core.integrazione.EsitoRichiesta}
  63.      *
  64.      * @param in InputStream to use for the reconstruction of the object type {@link org.openspcoop2.core.integrazione.EsitoRichiesta}
  65.      * @return Object type {@link org.openspcoop2.core.integrazione.EsitoRichiesta}
  66.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  67.      */
  68.     public EsitoRichiesta readEsitoRichiesta(InputStream in) throws DeserializerException {
  69.         return (EsitoRichiesta) this.xmlToObj(in, EsitoRichiesta.class);
  70.     }  
  71.    
  72.     /**
  73.      * Transform the byte array <var>in</var> in the object type {@link org.openspcoop2.core.integrazione.EsitoRichiesta}
  74.      *
  75.      * @param in Byte array to use for the reconstruction of the object type {@link org.openspcoop2.core.integrazione.EsitoRichiesta}
  76.      * @return Object type {@link org.openspcoop2.core.integrazione.EsitoRichiesta}
  77.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  78.      */
  79.     public EsitoRichiesta readEsitoRichiesta(byte[] in) throws DeserializerException {
  80.         return (EsitoRichiesta) this.xmlToObj(in, EsitoRichiesta.class);
  81.     }  
  82.    
  83.     /**
  84.      * Transform the String <var>in</var> in the object type {@link org.openspcoop2.core.integrazione.EsitoRichiesta}
  85.      *
  86.      * @param in String to use for the reconstruction of the object type {@link org.openspcoop2.core.integrazione.EsitoRichiesta}
  87.      * @return Object type {@link org.openspcoop2.core.integrazione.EsitoRichiesta}
  88.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  89.      */
  90.     public EsitoRichiesta readEsitoRichiestaFromString(String in) throws DeserializerException {
  91.         return (EsitoRichiesta) this.xmlToObj(in.getBytes(), EsitoRichiesta.class);
  92.     }  
  93.    
  94.    
  95.    

  96. }