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.eccezione.router_details.utils.serializer;

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

  22. import org.openspcoop2.core.eccezione.router_details.DominioSoggetto;
  23. import org.openspcoop2.core.eccezione.router_details.Dettaglio;
  24. import org.openspcoop2.core.eccezione.router_details.Dominio;
  25. import org.openspcoop2.core.eccezione.router_details.DettaglioRouting;

  26. import java.io.InputStream;
  27. import java.io.File;

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

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



  36.     /*
  37.      =================================================================================
  38.      Object: dominio-soggetto
  39.      =================================================================================
  40.     */
  41.    
  42.     /**
  43.      * Transform the xml in <var>fileName</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.DominioSoggetto}
  44.      *
  45.      * @param fileName Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.DominioSoggetto}
  46.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.DominioSoggetto}
  47.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  48.      */
  49.     public DominioSoggetto readDominioSoggetto(String fileName) throws DeserializerException {
  50.         return (DominioSoggetto) this.xmlToObj(fileName, DominioSoggetto.class);
  51.     }
  52.    
  53.     /**
  54.      * Transform the xml in <var>file</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.DominioSoggetto}
  55.      *
  56.      * @param file Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.DominioSoggetto}
  57.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.DominioSoggetto}
  58.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  59.      */
  60.     public DominioSoggetto readDominioSoggetto(File file) throws DeserializerException {
  61.         return (DominioSoggetto) this.xmlToObj(file, DominioSoggetto.class);
  62.     }
  63.    
  64.     /**
  65.      * Transform the input stream <var>in</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.DominioSoggetto}
  66.      *
  67.      * @param in InputStream to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.DominioSoggetto}
  68.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.DominioSoggetto}
  69.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  70.      */
  71.     public DominioSoggetto readDominioSoggetto(InputStream in) throws DeserializerException {
  72.         return (DominioSoggetto) this.xmlToObj(in, DominioSoggetto.class);
  73.     }  
  74.    
  75.     /**
  76.      * Transform the byte array <var>in</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.DominioSoggetto}
  77.      *
  78.      * @param in Byte array to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.DominioSoggetto}
  79.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.DominioSoggetto}
  80.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  81.      */
  82.     public DominioSoggetto readDominioSoggetto(byte[] in) throws DeserializerException {
  83.         return (DominioSoggetto) this.xmlToObj(in, DominioSoggetto.class);
  84.     }  
  85.    
  86.     /**
  87.      * Transform the String <var>in</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.DominioSoggetto}
  88.      *
  89.      * @param in String to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.DominioSoggetto}
  90.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.DominioSoggetto}
  91.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  92.      */
  93.     public DominioSoggetto readDominioSoggettoFromString(String in) throws DeserializerException {
  94.         return (DominioSoggetto) this.xmlToObj(in.getBytes(), DominioSoggetto.class);
  95.     }  
  96.    
  97.    
  98.    
  99.     /*
  100.      =================================================================================
  101.      Object: dettaglio
  102.      =================================================================================
  103.     */
  104.    
  105.     /**
  106.      * Transform the xml in <var>fileName</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.Dettaglio}
  107.      *
  108.      * @param fileName Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.Dettaglio}
  109.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.Dettaglio}
  110.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  111.      */
  112.     public Dettaglio readDettaglio(String fileName) throws DeserializerException {
  113.         return (Dettaglio) this.xmlToObj(fileName, Dettaglio.class);
  114.     }
  115.    
  116.     /**
  117.      * Transform the xml in <var>file</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.Dettaglio}
  118.      *
  119.      * @param file Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.Dettaglio}
  120.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.Dettaglio}
  121.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  122.      */
  123.     public Dettaglio readDettaglio(File file) throws DeserializerException {
  124.         return (Dettaglio) this.xmlToObj(file, Dettaglio.class);
  125.     }
  126.    
  127.     /**
  128.      * Transform the input stream <var>in</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.Dettaglio}
  129.      *
  130.      * @param in InputStream to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.Dettaglio}
  131.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.Dettaglio}
  132.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  133.      */
  134.     public Dettaglio readDettaglio(InputStream in) throws DeserializerException {
  135.         return (Dettaglio) this.xmlToObj(in, Dettaglio.class);
  136.     }  
  137.    
  138.     /**
  139.      * Transform the byte array <var>in</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.Dettaglio}
  140.      *
  141.      * @param in Byte array to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.Dettaglio}
  142.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.Dettaglio}
  143.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  144.      */
  145.     public Dettaglio readDettaglio(byte[] in) throws DeserializerException {
  146.         return (Dettaglio) this.xmlToObj(in, Dettaglio.class);
  147.     }  
  148.    
  149.     /**
  150.      * Transform the String <var>in</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.Dettaglio}
  151.      *
  152.      * @param in String to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.Dettaglio}
  153.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.Dettaglio}
  154.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  155.      */
  156.     public Dettaglio readDettaglioFromString(String in) throws DeserializerException {
  157.         return (Dettaglio) this.xmlToObj(in.getBytes(), Dettaglio.class);
  158.     }  
  159.    
  160.    
  161.    
  162.     /*
  163.      =================================================================================
  164.      Object: dominio
  165.      =================================================================================
  166.     */
  167.    
  168.     /**
  169.      * Transform the xml in <var>fileName</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.Dominio}
  170.      *
  171.      * @param fileName Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.Dominio}
  172.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.Dominio}
  173.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  174.      */
  175.     public Dominio readDominio(String fileName) throws DeserializerException {
  176.         return (Dominio) this.xmlToObj(fileName, Dominio.class);
  177.     }
  178.    
  179.     /**
  180.      * Transform the xml in <var>file</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.Dominio}
  181.      *
  182.      * @param file Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.Dominio}
  183.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.Dominio}
  184.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  185.      */
  186.     public Dominio readDominio(File file) throws DeserializerException {
  187.         return (Dominio) this.xmlToObj(file, Dominio.class);
  188.     }
  189.    
  190.     /**
  191.      * Transform the input stream <var>in</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.Dominio}
  192.      *
  193.      * @param in InputStream to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.Dominio}
  194.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.Dominio}
  195.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  196.      */
  197.     public Dominio readDominio(InputStream in) throws DeserializerException {
  198.         return (Dominio) this.xmlToObj(in, Dominio.class);
  199.     }  
  200.    
  201.     /**
  202.      * Transform the byte array <var>in</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.Dominio}
  203.      *
  204.      * @param in Byte array to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.Dominio}
  205.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.Dominio}
  206.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  207.      */
  208.     public Dominio readDominio(byte[] in) throws DeserializerException {
  209.         return (Dominio) this.xmlToObj(in, Dominio.class);
  210.     }  
  211.    
  212.     /**
  213.      * Transform the String <var>in</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.Dominio}
  214.      *
  215.      * @param in String to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.Dominio}
  216.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.Dominio}
  217.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  218.      */
  219.     public Dominio readDominioFromString(String in) throws DeserializerException {
  220.         return (Dominio) this.xmlToObj(in.getBytes(), Dominio.class);
  221.     }  
  222.    
  223.    
  224.    
  225.     /*
  226.      =================================================================================
  227.      Object: dettaglio-routing
  228.      =================================================================================
  229.     */
  230.    
  231.     /**
  232.      * Transform the xml in <var>fileName</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.DettaglioRouting}
  233.      *
  234.      * @param fileName Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.DettaglioRouting}
  235.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.DettaglioRouting}
  236.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  237.      */
  238.     public DettaglioRouting readDettaglioRouting(String fileName) throws DeserializerException {
  239.         return (DettaglioRouting) this.xmlToObj(fileName, DettaglioRouting.class);
  240.     }
  241.    
  242.     /**
  243.      * Transform the xml in <var>file</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.DettaglioRouting}
  244.      *
  245.      * @param file Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.DettaglioRouting}
  246.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.DettaglioRouting}
  247.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  248.      */
  249.     public DettaglioRouting readDettaglioRouting(File file) throws DeserializerException {
  250.         return (DettaglioRouting) this.xmlToObj(file, DettaglioRouting.class);
  251.     }
  252.    
  253.     /**
  254.      * Transform the input stream <var>in</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.DettaglioRouting}
  255.      *
  256.      * @param in InputStream to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.DettaglioRouting}
  257.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.DettaglioRouting}
  258.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  259.      */
  260.     public DettaglioRouting readDettaglioRouting(InputStream in) throws DeserializerException {
  261.         return (DettaglioRouting) this.xmlToObj(in, DettaglioRouting.class);
  262.     }  
  263.    
  264.     /**
  265.      * Transform the byte array <var>in</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.DettaglioRouting}
  266.      *
  267.      * @param in Byte array to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.DettaglioRouting}
  268.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.DettaglioRouting}
  269.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  270.      */
  271.     public DettaglioRouting readDettaglioRouting(byte[] in) throws DeserializerException {
  272.         return (DettaglioRouting) this.xmlToObj(in, DettaglioRouting.class);
  273.     }  
  274.    
  275.     /**
  276.      * Transform the String <var>in</var> in the object type {@link org.openspcoop2.core.eccezione.router_details.DettaglioRouting}
  277.      *
  278.      * @param in String to use for the reconstruction of the object type {@link org.openspcoop2.core.eccezione.router_details.DettaglioRouting}
  279.      * @return Object type {@link org.openspcoop2.core.eccezione.router_details.DettaglioRouting}
  280.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  281.      */
  282.     public DettaglioRouting readDettaglioRoutingFromString(String in) throws DeserializerException {
  283.         return (DettaglioRouting) this.xmlToObj(in.getBytes(), DettaglioRouting.class);
  284.     }  
  285.    
  286.    
  287.    

  288. }