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

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

  22. import org.openspcoop2.core.diagnostica.DominioSoggetto;
  23. import org.openspcoop2.core.diagnostica.MessaggioDiagnostico;
  24. import org.openspcoop2.core.diagnostica.ElencoMessaggiDiagnostici;
  25. import org.openspcoop2.core.diagnostica.DominioDiagnostico;
  26. import org.openspcoop2.core.diagnostica.Proprieta;
  27. import org.openspcoop2.core.diagnostica.Protocollo;

  28. import java.io.InputStream;
  29. import java.io.File;

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

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



  38.     /*
  39.      =================================================================================
  40.      Object: dominio-soggetto
  41.      =================================================================================
  42.     */
  43.    
  44.     /**
  45.      * Transform the xml in <var>fileName</var> in the object type {@link org.openspcoop2.core.diagnostica.DominioSoggetto}
  46.      *
  47.      * @param fileName Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.DominioSoggetto}
  48.      * @return Object type {@link org.openspcoop2.core.diagnostica.DominioSoggetto}
  49.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  50.      */
  51.     public DominioSoggetto readDominioSoggetto(String fileName) throws DeserializerException {
  52.         return (DominioSoggetto) this.xmlToObj(fileName, DominioSoggetto.class);
  53.     }
  54.    
  55.     /**
  56.      * Transform the xml in <var>file</var> in the object type {@link org.openspcoop2.core.diagnostica.DominioSoggetto}
  57.      *
  58.      * @param file Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.DominioSoggetto}
  59.      * @return Object type {@link org.openspcoop2.core.diagnostica.DominioSoggetto}
  60.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  61.      */
  62.     public DominioSoggetto readDominioSoggetto(File file) throws DeserializerException {
  63.         return (DominioSoggetto) this.xmlToObj(file, DominioSoggetto.class);
  64.     }
  65.    
  66.     /**
  67.      * Transform the input stream <var>in</var> in the object type {@link org.openspcoop2.core.diagnostica.DominioSoggetto}
  68.      *
  69.      * @param in InputStream to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.DominioSoggetto}
  70.      * @return Object type {@link org.openspcoop2.core.diagnostica.DominioSoggetto}
  71.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  72.      */
  73.     public DominioSoggetto readDominioSoggetto(InputStream in) throws DeserializerException {
  74.         return (DominioSoggetto) this.xmlToObj(in, DominioSoggetto.class);
  75.     }  
  76.    
  77.     /**
  78.      * Transform the byte array <var>in</var> in the object type {@link org.openspcoop2.core.diagnostica.DominioSoggetto}
  79.      *
  80.      * @param in Byte array to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.DominioSoggetto}
  81.      * @return Object type {@link org.openspcoop2.core.diagnostica.DominioSoggetto}
  82.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  83.      */
  84.     public DominioSoggetto readDominioSoggetto(byte[] in) throws DeserializerException {
  85.         return (DominioSoggetto) this.xmlToObj(in, DominioSoggetto.class);
  86.     }  
  87.    
  88.     /**
  89.      * Transform the String <var>in</var> in the object type {@link org.openspcoop2.core.diagnostica.DominioSoggetto}
  90.      *
  91.      * @param in String to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.DominioSoggetto}
  92.      * @return Object type {@link org.openspcoop2.core.diagnostica.DominioSoggetto}
  93.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  94.      */
  95.     public DominioSoggetto readDominioSoggettoFromString(String in) throws DeserializerException {
  96.         return (DominioSoggetto) this.xmlToObj(in.getBytes(), DominioSoggetto.class);
  97.     }  
  98.    
  99.    
  100.    
  101.     /*
  102.      =================================================================================
  103.      Object: messaggio-diagnostico
  104.      =================================================================================
  105.     */
  106.    
  107.     /**
  108.      * Transform the xml in <var>fileName</var> in the object type {@link org.openspcoop2.core.diagnostica.MessaggioDiagnostico}
  109.      *
  110.      * @param fileName Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.MessaggioDiagnostico}
  111.      * @return Object type {@link org.openspcoop2.core.diagnostica.MessaggioDiagnostico}
  112.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  113.      */
  114.     public MessaggioDiagnostico readMessaggioDiagnostico(String fileName) throws DeserializerException {
  115.         return (MessaggioDiagnostico) this.xmlToObj(fileName, MessaggioDiagnostico.class);
  116.     }
  117.    
  118.     /**
  119.      * Transform the xml in <var>file</var> in the object type {@link org.openspcoop2.core.diagnostica.MessaggioDiagnostico}
  120.      *
  121.      * @param file Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.MessaggioDiagnostico}
  122.      * @return Object type {@link org.openspcoop2.core.diagnostica.MessaggioDiagnostico}
  123.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  124.      */
  125.     public MessaggioDiagnostico readMessaggioDiagnostico(File file) throws DeserializerException {
  126.         return (MessaggioDiagnostico) this.xmlToObj(file, MessaggioDiagnostico.class);
  127.     }
  128.    
  129.     /**
  130.      * Transform the input stream <var>in</var> in the object type {@link org.openspcoop2.core.diagnostica.MessaggioDiagnostico}
  131.      *
  132.      * @param in InputStream to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.MessaggioDiagnostico}
  133.      * @return Object type {@link org.openspcoop2.core.diagnostica.MessaggioDiagnostico}
  134.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  135.      */
  136.     public MessaggioDiagnostico readMessaggioDiagnostico(InputStream in) throws DeserializerException {
  137.         return (MessaggioDiagnostico) this.xmlToObj(in, MessaggioDiagnostico.class);
  138.     }  
  139.    
  140.     /**
  141.      * Transform the byte array <var>in</var> in the object type {@link org.openspcoop2.core.diagnostica.MessaggioDiagnostico}
  142.      *
  143.      * @param in Byte array to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.MessaggioDiagnostico}
  144.      * @return Object type {@link org.openspcoop2.core.diagnostica.MessaggioDiagnostico}
  145.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  146.      */
  147.     public MessaggioDiagnostico readMessaggioDiagnostico(byte[] in) throws DeserializerException {
  148.         return (MessaggioDiagnostico) this.xmlToObj(in, MessaggioDiagnostico.class);
  149.     }  
  150.    
  151.     /**
  152.      * Transform the String <var>in</var> in the object type {@link org.openspcoop2.core.diagnostica.MessaggioDiagnostico}
  153.      *
  154.      * @param in String to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.MessaggioDiagnostico}
  155.      * @return Object type {@link org.openspcoop2.core.diagnostica.MessaggioDiagnostico}
  156.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  157.      */
  158.     public MessaggioDiagnostico readMessaggioDiagnosticoFromString(String in) throws DeserializerException {
  159.         return (MessaggioDiagnostico) this.xmlToObj(in.getBytes(), MessaggioDiagnostico.class);
  160.     }  
  161.    
  162.    
  163.    
  164.     /*
  165.      =================================================================================
  166.      Object: elenco-messaggi-diagnostici
  167.      =================================================================================
  168.     */
  169.    
  170.     /**
  171.      * Transform the xml in <var>fileName</var> in the object type {@link org.openspcoop2.core.diagnostica.ElencoMessaggiDiagnostici}
  172.      *
  173.      * @param fileName Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.ElencoMessaggiDiagnostici}
  174.      * @return Object type {@link org.openspcoop2.core.diagnostica.ElencoMessaggiDiagnostici}
  175.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  176.      */
  177.     public ElencoMessaggiDiagnostici readElencoMessaggiDiagnostici(String fileName) throws DeserializerException {
  178.         return (ElencoMessaggiDiagnostici) this.xmlToObj(fileName, ElencoMessaggiDiagnostici.class);
  179.     }
  180.    
  181.     /**
  182.      * Transform the xml in <var>file</var> in the object type {@link org.openspcoop2.core.diagnostica.ElencoMessaggiDiagnostici}
  183.      *
  184.      * @param file Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.ElencoMessaggiDiagnostici}
  185.      * @return Object type {@link org.openspcoop2.core.diagnostica.ElencoMessaggiDiagnostici}
  186.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  187.      */
  188.     public ElencoMessaggiDiagnostici readElencoMessaggiDiagnostici(File file) throws DeserializerException {
  189.         return (ElencoMessaggiDiagnostici) this.xmlToObj(file, ElencoMessaggiDiagnostici.class);
  190.     }
  191.    
  192.     /**
  193.      * Transform the input stream <var>in</var> in the object type {@link org.openspcoop2.core.diagnostica.ElencoMessaggiDiagnostici}
  194.      *
  195.      * @param in InputStream to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.ElencoMessaggiDiagnostici}
  196.      * @return Object type {@link org.openspcoop2.core.diagnostica.ElencoMessaggiDiagnostici}
  197.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  198.      */
  199.     public ElencoMessaggiDiagnostici readElencoMessaggiDiagnostici(InputStream in) throws DeserializerException {
  200.         return (ElencoMessaggiDiagnostici) this.xmlToObj(in, ElencoMessaggiDiagnostici.class);
  201.     }  
  202.    
  203.     /**
  204.      * Transform the byte array <var>in</var> in the object type {@link org.openspcoop2.core.diagnostica.ElencoMessaggiDiagnostici}
  205.      *
  206.      * @param in Byte array to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.ElencoMessaggiDiagnostici}
  207.      * @return Object type {@link org.openspcoop2.core.diagnostica.ElencoMessaggiDiagnostici}
  208.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  209.      */
  210.     public ElencoMessaggiDiagnostici readElencoMessaggiDiagnostici(byte[] in) throws DeserializerException {
  211.         return (ElencoMessaggiDiagnostici) this.xmlToObj(in, ElencoMessaggiDiagnostici.class);
  212.     }  
  213.    
  214.     /**
  215.      * Transform the String <var>in</var> in the object type {@link org.openspcoop2.core.diagnostica.ElencoMessaggiDiagnostici}
  216.      *
  217.      * @param in String to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.ElencoMessaggiDiagnostici}
  218.      * @return Object type {@link org.openspcoop2.core.diagnostica.ElencoMessaggiDiagnostici}
  219.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  220.      */
  221.     public ElencoMessaggiDiagnostici readElencoMessaggiDiagnosticiFromString(String in) throws DeserializerException {
  222.         return (ElencoMessaggiDiagnostici) this.xmlToObj(in.getBytes(), ElencoMessaggiDiagnostici.class);
  223.     }  
  224.    
  225.    
  226.    
  227.     /*
  228.      =================================================================================
  229.      Object: dominio-diagnostico
  230.      =================================================================================
  231.     */
  232.    
  233.     /**
  234.      * Transform the xml in <var>fileName</var> in the object type {@link org.openspcoop2.core.diagnostica.DominioDiagnostico}
  235.      *
  236.      * @param fileName Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.DominioDiagnostico}
  237.      * @return Object type {@link org.openspcoop2.core.diagnostica.DominioDiagnostico}
  238.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  239.      */
  240.     public DominioDiagnostico readDominioDiagnostico(String fileName) throws DeserializerException {
  241.         return (DominioDiagnostico) this.xmlToObj(fileName, DominioDiagnostico.class);
  242.     }
  243.    
  244.     /**
  245.      * Transform the xml in <var>file</var> in the object type {@link org.openspcoop2.core.diagnostica.DominioDiagnostico}
  246.      *
  247.      * @param file Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.DominioDiagnostico}
  248.      * @return Object type {@link org.openspcoop2.core.diagnostica.DominioDiagnostico}
  249.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  250.      */
  251.     public DominioDiagnostico readDominioDiagnostico(File file) throws DeserializerException {
  252.         return (DominioDiagnostico) this.xmlToObj(file, DominioDiagnostico.class);
  253.     }
  254.    
  255.     /**
  256.      * Transform the input stream <var>in</var> in the object type {@link org.openspcoop2.core.diagnostica.DominioDiagnostico}
  257.      *
  258.      * @param in InputStream to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.DominioDiagnostico}
  259.      * @return Object type {@link org.openspcoop2.core.diagnostica.DominioDiagnostico}
  260.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  261.      */
  262.     public DominioDiagnostico readDominioDiagnostico(InputStream in) throws DeserializerException {
  263.         return (DominioDiagnostico) this.xmlToObj(in, DominioDiagnostico.class);
  264.     }  
  265.    
  266.     /**
  267.      * Transform the byte array <var>in</var> in the object type {@link org.openspcoop2.core.diagnostica.DominioDiagnostico}
  268.      *
  269.      * @param in Byte array to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.DominioDiagnostico}
  270.      * @return Object type {@link org.openspcoop2.core.diagnostica.DominioDiagnostico}
  271.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  272.      */
  273.     public DominioDiagnostico readDominioDiagnostico(byte[] in) throws DeserializerException {
  274.         return (DominioDiagnostico) this.xmlToObj(in, DominioDiagnostico.class);
  275.     }  
  276.    
  277.     /**
  278.      * Transform the String <var>in</var> in the object type {@link org.openspcoop2.core.diagnostica.DominioDiagnostico}
  279.      *
  280.      * @param in String to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.DominioDiagnostico}
  281.      * @return Object type {@link org.openspcoop2.core.diagnostica.DominioDiagnostico}
  282.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  283.      */
  284.     public DominioDiagnostico readDominioDiagnosticoFromString(String in) throws DeserializerException {
  285.         return (DominioDiagnostico) this.xmlToObj(in.getBytes(), DominioDiagnostico.class);
  286.     }  
  287.    
  288.    
  289.    
  290.     /*
  291.      =================================================================================
  292.      Object: proprieta
  293.      =================================================================================
  294.     */
  295.    
  296.     /**
  297.      * Transform the xml in <var>fileName</var> in the object type {@link org.openspcoop2.core.diagnostica.Proprieta}
  298.      *
  299.      * @param fileName Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.Proprieta}
  300.      * @return Object type {@link org.openspcoop2.core.diagnostica.Proprieta}
  301.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  302.      */
  303.     public Proprieta readProprieta(String fileName) throws DeserializerException {
  304.         return (Proprieta) this.xmlToObj(fileName, Proprieta.class);
  305.     }
  306.    
  307.     /**
  308.      * Transform the xml in <var>file</var> in the object type {@link org.openspcoop2.core.diagnostica.Proprieta}
  309.      *
  310.      * @param file Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.Proprieta}
  311.      * @return Object type {@link org.openspcoop2.core.diagnostica.Proprieta}
  312.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  313.      */
  314.     public Proprieta readProprieta(File file) throws DeserializerException {
  315.         return (Proprieta) this.xmlToObj(file, Proprieta.class);
  316.     }
  317.    
  318.     /**
  319.      * Transform the input stream <var>in</var> in the object type {@link org.openspcoop2.core.diagnostica.Proprieta}
  320.      *
  321.      * @param in InputStream to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.Proprieta}
  322.      * @return Object type {@link org.openspcoop2.core.diagnostica.Proprieta}
  323.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  324.      */
  325.     public Proprieta readProprieta(InputStream in) throws DeserializerException {
  326.         return (Proprieta) this.xmlToObj(in, Proprieta.class);
  327.     }  
  328.    
  329.     /**
  330.      * Transform the byte array <var>in</var> in the object type {@link org.openspcoop2.core.diagnostica.Proprieta}
  331.      *
  332.      * @param in Byte array to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.Proprieta}
  333.      * @return Object type {@link org.openspcoop2.core.diagnostica.Proprieta}
  334.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  335.      */
  336.     public Proprieta readProprieta(byte[] in) throws DeserializerException {
  337.         return (Proprieta) this.xmlToObj(in, Proprieta.class);
  338.     }  
  339.    
  340.     /**
  341.      * Transform the String <var>in</var> in the object type {@link org.openspcoop2.core.diagnostica.Proprieta}
  342.      *
  343.      * @param in String to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.Proprieta}
  344.      * @return Object type {@link org.openspcoop2.core.diagnostica.Proprieta}
  345.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  346.      */
  347.     public Proprieta readProprietaFromString(String in) throws DeserializerException {
  348.         return (Proprieta) this.xmlToObj(in.getBytes(), Proprieta.class);
  349.     }  
  350.    
  351.    
  352.    
  353.     /*
  354.      =================================================================================
  355.      Object: protocollo
  356.      =================================================================================
  357.     */
  358.    
  359.     /**
  360.      * Transform the xml in <var>fileName</var> in the object type {@link org.openspcoop2.core.diagnostica.Protocollo}
  361.      *
  362.      * @param fileName Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.Protocollo}
  363.      * @return Object type {@link org.openspcoop2.core.diagnostica.Protocollo}
  364.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  365.      */
  366.     public Protocollo readProtocollo(String fileName) throws DeserializerException {
  367.         return (Protocollo) this.xmlToObj(fileName, Protocollo.class);
  368.     }
  369.    
  370.     /**
  371.      * Transform the xml in <var>file</var> in the object type {@link org.openspcoop2.core.diagnostica.Protocollo}
  372.      *
  373.      * @param file Xml file to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.Protocollo}
  374.      * @return Object type {@link org.openspcoop2.core.diagnostica.Protocollo}
  375.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  376.      */
  377.     public Protocollo readProtocollo(File file) throws DeserializerException {
  378.         return (Protocollo) this.xmlToObj(file, Protocollo.class);
  379.     }
  380.    
  381.     /**
  382.      * Transform the input stream <var>in</var> in the object type {@link org.openspcoop2.core.diagnostica.Protocollo}
  383.      *
  384.      * @param in InputStream to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.Protocollo}
  385.      * @return Object type {@link org.openspcoop2.core.diagnostica.Protocollo}
  386.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  387.      */
  388.     public Protocollo readProtocollo(InputStream in) throws DeserializerException {
  389.         return (Protocollo) this.xmlToObj(in, Protocollo.class);
  390.     }  
  391.    
  392.     /**
  393.      * Transform the byte array <var>in</var> in the object type {@link org.openspcoop2.core.diagnostica.Protocollo}
  394.      *
  395.      * @param in Byte array to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.Protocollo}
  396.      * @return Object type {@link org.openspcoop2.core.diagnostica.Protocollo}
  397.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  398.      */
  399.     public Protocollo readProtocollo(byte[] in) throws DeserializerException {
  400.         return (Protocollo) this.xmlToObj(in, Protocollo.class);
  401.     }  
  402.    
  403.     /**
  404.      * Transform the String <var>in</var> in the object type {@link org.openspcoop2.core.diagnostica.Protocollo}
  405.      *
  406.      * @param in String to use for the reconstruction of the object type {@link org.openspcoop2.core.diagnostica.Protocollo}
  407.      * @return Object type {@link org.openspcoop2.core.diagnostica.Protocollo}
  408.      * @throws DeserializerException The exception that is thrown when an error occurs during deserialization
  409.      */
  410.     public Protocollo readProtocolloFromString(String in) throws DeserializerException {
  411.         return (Protocollo) this.xmlToObj(in.getBytes(), Protocollo.class);
  412.     }  
  413.    
  414.    
  415.    

  416. }