AbstractSerializer.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 it.cnipa.schemas._2003.egovit.exception1_0.utils.serializer;

  21. import org.openspcoop2.generic_project.exception.SerializerException;
  22. import org.openspcoop2.utils.beans.WriteToSerializerType;
  23. import org.openspcoop2.utils.xml.JaxbUtils;

  24. import it.cnipa.schemas._2003.egovit.exception1_0.EccezioneBusta;
  25. import it.cnipa.schemas._2003.egovit.exception1_0.Eccezione;
  26. import it.cnipa.schemas._2003.egovit.exception1_0.EccezioneProcessamento;
  27. import it.cnipa.schemas._2003.egovit.exception1_0.MessaggioDiErroreApplicativo;

  28. import java.io.ByteArrayOutputStream;
  29. import java.io.FileOutputStream;
  30. import java.io.OutputStream;
  31. import java.io.File;
  32. import java.lang.reflect.Method;

  33. import javax.xml.bind.JAXBElement;

  34. /**    
  35.  * XML Serializer of beans
  36.  *
  37.  * @author Poli Andrea (poli@link.it)
  38.  * @author $Author$
  39.  * @version $Rev$, $Date$
  40.  */
  41. public abstract class AbstractSerializer {


  42.     protected abstract WriteToSerializerType getType();
  43.    
  44.     protected void _objToXml(OutputStream out, Class<?> c, Object object,
  45.             boolean prettyPrint) throws Exception {
  46.         if(object instanceof JAXBElement){
  47.             // solo per il tipo WriteToSerializerType.JAXB
  48.             JaxbUtils.objToXml(out, c, object, prettyPrint);
  49.         }else{
  50.             Method m = c.getMethod("writeTo", OutputStream.class, WriteToSerializerType.class);
  51.             m.invoke(object, out, this.getType());
  52.         }
  53.     }
  54.    
  55.     protected void objToXml(OutputStream out,Class<?> c,Object object,boolean prettyPrint) throws SerializerException{
  56.         try{
  57.             this._objToXml(out, c, object, prettyPrint);
  58.         }catch(Exception e){
  59.             throw new SerializerException(e.getMessage(), e);
  60.         }
  61.         finally{
  62.             try{
  63.                 out.flush();
  64.             }catch(Exception e){
  65.                 // ignore
  66.             }
  67.         }
  68.     }
  69.     protected void objToXml(String fileName,Class<?> c,Object object,boolean prettyPrint) throws SerializerException{
  70.         try{
  71.             this.objToXml(new File(fileName), c, object, prettyPrint);
  72.         }catch(Exception e){
  73.             throw new SerializerException(e.getMessage(), e);
  74.         }
  75.     }
  76.     protected void objToXml(File file,Class<?> c,Object object,boolean prettyPrint) throws SerializerException{
  77.         FileOutputStream fout = null;
  78.         try{
  79.             fout = new FileOutputStream(file);
  80.             this._objToXml(fout, c, object, prettyPrint);
  81.         }catch(Exception e){
  82.             throw new SerializerException(e.getMessage(), e);
  83.         }
  84.         finally{
  85.             try{
  86.                 if(fout!=null){
  87.                     fout.flush();
  88.                 }
  89.             }catch(Exception e){
  90.                 // ignore
  91.             }
  92.             try{
  93.                 if(fout!=null){
  94.                     fout.close();
  95.                 }
  96.             }catch(Exception e){
  97.                 // ignore
  98.             }
  99.         }
  100.     }
  101.     protected ByteArrayOutputStream objToXml(Class<?> c,Object object,boolean prettyPrint) throws SerializerException{
  102.         ByteArrayOutputStream bout = null;
  103.         try{
  104.             bout = new ByteArrayOutputStream();
  105.             this._objToXml(bout, c, object, prettyPrint);
  106.         }catch(Exception e){
  107.             throw new SerializerException(e.getMessage(), e);
  108.         }
  109.         finally{
  110.             try{
  111.                 if(bout!=null){
  112.                     bout.flush();
  113.                 }
  114.             }catch(Exception e){
  115.                 // ignore
  116.             }
  117.             try{
  118.                 if(bout!=null){
  119.                     bout.close();
  120.                 }
  121.             }catch(Exception e){
  122.                 // ignore
  123.             }
  124.         }
  125.         return bout;
  126.     }




  127.     /*
  128.      =================================================================================
  129.      Object: EccezioneBusta
  130.      =================================================================================
  131.     */
  132.    
  133.     /**
  134.      * Serialize to file system in <var>fileName</var> the object <var>eccezioneBusta</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneBusta}
  135.      *
  136.      * @param fileName Xml file to serialize the object <var>eccezioneBusta</var>
  137.      * @param eccezioneBusta Object to be serialized in xml file <var>fileName</var>
  138.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  139.      */
  140.     public void write(String fileName,EccezioneBusta eccezioneBusta) throws SerializerException {
  141.         this.objToXml(fileName, EccezioneBusta.class, eccezioneBusta, false);
  142.     }
  143.     /**
  144.      * Serialize to file system in <var>fileName</var> the object <var>eccezioneBusta</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneBusta}
  145.      *
  146.      * @param fileName Xml file to serialize the object <var>eccezioneBusta</var>
  147.      * @param eccezioneBusta Object to be serialized in xml file <var>fileName</var>
  148.      * @param prettyPrint if true output the XML with indenting
  149.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  150.      */
  151.     public void write(String fileName,EccezioneBusta eccezioneBusta,boolean prettyPrint) throws SerializerException {
  152.         this.objToXml(fileName, EccezioneBusta.class, eccezioneBusta, prettyPrint);
  153.     }
  154.    
  155.     /**
  156.      * Serialize to file system in <var>file</var> the object <var>eccezioneBusta</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneBusta}
  157.      *
  158.      * @param file Xml file to serialize the object <var>eccezioneBusta</var>
  159.      * @param eccezioneBusta Object to be serialized in xml file <var>fileName</var>
  160.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  161.      */
  162.     public void write(File file,EccezioneBusta eccezioneBusta) throws SerializerException {
  163.         this.objToXml(file, EccezioneBusta.class, eccezioneBusta, false);
  164.     }
  165.     /**
  166.      * Serialize to file system in <var>file</var> the object <var>eccezioneBusta</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneBusta}
  167.      *
  168.      * @param file Xml file to serialize the object <var>eccezioneBusta</var>
  169.      * @param eccezioneBusta Object to be serialized in xml file <var>fileName</var>
  170.      * @param prettyPrint if true output the XML with indenting
  171.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  172.      */
  173.     public void write(File file,EccezioneBusta eccezioneBusta,boolean prettyPrint) throws SerializerException {
  174.         this.objToXml(file, EccezioneBusta.class, eccezioneBusta, prettyPrint);
  175.     }
  176.    
  177.     /**
  178.      * Serialize to output stream <var>out</var> the object <var>eccezioneBusta</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneBusta}
  179.      *
  180.      * @param out OutputStream to serialize the object <var>eccezioneBusta</var>
  181.      * @param eccezioneBusta Object to be serialized in xml file <var>fileName</var>
  182.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  183.      */
  184.     public void write(OutputStream out,EccezioneBusta eccezioneBusta) throws SerializerException {
  185.         this.objToXml(out, EccezioneBusta.class, eccezioneBusta, false);
  186.     }
  187.     /**
  188.      * Serialize to output stream <var>out</var> the object <var>eccezioneBusta</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneBusta}
  189.      *
  190.      * @param out OutputStream to serialize the object <var>eccezioneBusta</var>
  191.      * @param eccezioneBusta Object to be serialized in xml file <var>fileName</var>
  192.      * @param prettyPrint if true output the XML with indenting
  193.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  194.      */
  195.     public void write(OutputStream out,EccezioneBusta eccezioneBusta,boolean prettyPrint) throws SerializerException {
  196.         this.objToXml(out, EccezioneBusta.class, eccezioneBusta, prettyPrint);
  197.     }
  198.            
  199.     /**
  200.      * Serialize to byte array the object <var>eccezioneBusta</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneBusta}
  201.      *
  202.      * @param eccezioneBusta Object to be serialized
  203.      * @return Object to be serialized in byte array
  204.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  205.      */
  206.     public byte[] toByteArray(EccezioneBusta eccezioneBusta) throws SerializerException {
  207.         return this.objToXml(EccezioneBusta.class, eccezioneBusta, false).toByteArray();
  208.     }
  209.     /**
  210.      * Serialize to byte array the object <var>eccezioneBusta</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneBusta}
  211.      *
  212.      * @param eccezioneBusta Object to be serialized
  213.      * @param prettyPrint if true output the XML with indenting
  214.      * @return Object to be serialized in byte array
  215.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  216.      */
  217.     public byte[] toByteArray(EccezioneBusta eccezioneBusta,boolean prettyPrint) throws SerializerException {
  218.         return this.objToXml(EccezioneBusta.class, eccezioneBusta, prettyPrint).toByteArray();
  219.     }
  220.    
  221.     /**
  222.      * Serialize to String the object <var>eccezioneBusta</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneBusta}
  223.      *
  224.      * @param eccezioneBusta Object to be serialized
  225.      * @return Object to be serialized as String
  226.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  227.      */
  228.     public String toString(EccezioneBusta eccezioneBusta) throws SerializerException {
  229.         return this.objToXml(EccezioneBusta.class, eccezioneBusta, false).toString();
  230.     }
  231.     /**
  232.      * Serialize to String the object <var>eccezioneBusta</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneBusta}
  233.      *
  234.      * @param eccezioneBusta Object to be serialized
  235.      * @param prettyPrint if true output the XML with indenting
  236.      * @return Object to be serialized as String
  237.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  238.      */
  239.     public String toString(EccezioneBusta eccezioneBusta,boolean prettyPrint) throws SerializerException {
  240.         return this.objToXml(EccezioneBusta.class, eccezioneBusta, prettyPrint).toString();
  241.     }
  242.    
  243.    
  244.    
  245.     /*
  246.      =================================================================================
  247.      Object: Eccezione
  248.      =================================================================================
  249.     */
  250.    
  251.     /**
  252.      * Serialize to file system in <var>fileName</var> the object <var>eccezione</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.Eccezione}
  253.      *
  254.      * @param fileName Xml file to serialize the object <var>eccezione</var>
  255.      * @param eccezione Object to be serialized in xml file <var>fileName</var>
  256.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  257.      */
  258.     public void write(String fileName,Eccezione eccezione) throws SerializerException {
  259.         this.objToXml(fileName, Eccezione.class, eccezione, false);
  260.     }
  261.     /**
  262.      * Serialize to file system in <var>fileName</var> the object <var>eccezione</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.Eccezione}
  263.      *
  264.      * @param fileName Xml file to serialize the object <var>eccezione</var>
  265.      * @param eccezione Object to be serialized in xml file <var>fileName</var>
  266.      * @param prettyPrint if true output the XML with indenting
  267.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  268.      */
  269.     public void write(String fileName,Eccezione eccezione,boolean prettyPrint) throws SerializerException {
  270.         this.objToXml(fileName, Eccezione.class, eccezione, prettyPrint);
  271.     }
  272.    
  273.     /**
  274.      * Serialize to file system in <var>file</var> the object <var>eccezione</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.Eccezione}
  275.      *
  276.      * @param file Xml file to serialize the object <var>eccezione</var>
  277.      * @param eccezione Object to be serialized in xml file <var>fileName</var>
  278.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  279.      */
  280.     public void write(File file,Eccezione eccezione) throws SerializerException {
  281.         this.objToXml(file, Eccezione.class, eccezione, false);
  282.     }
  283.     /**
  284.      * Serialize to file system in <var>file</var> the object <var>eccezione</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.Eccezione}
  285.      *
  286.      * @param file Xml file to serialize the object <var>eccezione</var>
  287.      * @param eccezione Object to be serialized in xml file <var>fileName</var>
  288.      * @param prettyPrint if true output the XML with indenting
  289.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  290.      */
  291.     public void write(File file,Eccezione eccezione,boolean prettyPrint) throws SerializerException {
  292.         this.objToXml(file, Eccezione.class, eccezione, prettyPrint);
  293.     }
  294.    
  295.     /**
  296.      * Serialize to output stream <var>out</var> the object <var>eccezione</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.Eccezione}
  297.      *
  298.      * @param out OutputStream to serialize the object <var>eccezione</var>
  299.      * @param eccezione Object to be serialized in xml file <var>fileName</var>
  300.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  301.      */
  302.     public void write(OutputStream out,Eccezione eccezione) throws SerializerException {
  303.         this.objToXml(out, Eccezione.class, eccezione, false);
  304.     }
  305.     /**
  306.      * Serialize to output stream <var>out</var> the object <var>eccezione</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.Eccezione}
  307.      *
  308.      * @param out OutputStream to serialize the object <var>eccezione</var>
  309.      * @param eccezione Object to be serialized in xml file <var>fileName</var>
  310.      * @param prettyPrint if true output the XML with indenting
  311.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  312.      */
  313.     public void write(OutputStream out,Eccezione eccezione,boolean prettyPrint) throws SerializerException {
  314.         this.objToXml(out, Eccezione.class, eccezione, prettyPrint);
  315.     }
  316.            
  317.     /**
  318.      * Serialize to byte array the object <var>eccezione</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.Eccezione}
  319.      *
  320.      * @param eccezione Object to be serialized
  321.      * @return Object to be serialized in byte array
  322.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  323.      */
  324.     public byte[] toByteArray(Eccezione eccezione) throws SerializerException {
  325.         return this.objToXml(Eccezione.class, eccezione, false).toByteArray();
  326.     }
  327.     /**
  328.      * Serialize to byte array the object <var>eccezione</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.Eccezione}
  329.      *
  330.      * @param eccezione Object to be serialized
  331.      * @param prettyPrint if true output the XML with indenting
  332.      * @return Object to be serialized in byte array
  333.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  334.      */
  335.     public byte[] toByteArray(Eccezione eccezione,boolean prettyPrint) throws SerializerException {
  336.         return this.objToXml(Eccezione.class, eccezione, prettyPrint).toByteArray();
  337.     }
  338.    
  339.     /**
  340.      * Serialize to String the object <var>eccezione</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.Eccezione}
  341.      *
  342.      * @param eccezione Object to be serialized
  343.      * @return Object to be serialized as String
  344.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  345.      */
  346.     public String toString(Eccezione eccezione) throws SerializerException {
  347.         return this.objToXml(Eccezione.class, eccezione, false).toString();
  348.     }
  349.     /**
  350.      * Serialize to String the object <var>eccezione</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.Eccezione}
  351.      *
  352.      * @param eccezione Object to be serialized
  353.      * @param prettyPrint if true output the XML with indenting
  354.      * @return Object to be serialized as String
  355.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  356.      */
  357.     public String toString(Eccezione eccezione,boolean prettyPrint) throws SerializerException {
  358.         return this.objToXml(Eccezione.class, eccezione, prettyPrint).toString();
  359.     }
  360.    
  361.    
  362.    
  363.     /*
  364.      =================================================================================
  365.      Object: EccezioneProcessamento
  366.      =================================================================================
  367.     */
  368.    
  369.     /**
  370.      * Serialize to file system in <var>fileName</var> the object <var>eccezioneProcessamento</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneProcessamento}
  371.      *
  372.      * @param fileName Xml file to serialize the object <var>eccezioneProcessamento</var>
  373.      * @param eccezioneProcessamento Object to be serialized in xml file <var>fileName</var>
  374.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  375.      */
  376.     public void write(String fileName,EccezioneProcessamento eccezioneProcessamento) throws SerializerException {
  377.         this.objToXml(fileName, EccezioneProcessamento.class, eccezioneProcessamento, false);
  378.     }
  379.     /**
  380.      * Serialize to file system in <var>fileName</var> the object <var>eccezioneProcessamento</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneProcessamento}
  381.      *
  382.      * @param fileName Xml file to serialize the object <var>eccezioneProcessamento</var>
  383.      * @param eccezioneProcessamento Object to be serialized in xml file <var>fileName</var>
  384.      * @param prettyPrint if true output the XML with indenting
  385.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  386.      */
  387.     public void write(String fileName,EccezioneProcessamento eccezioneProcessamento,boolean prettyPrint) throws SerializerException {
  388.         this.objToXml(fileName, EccezioneProcessamento.class, eccezioneProcessamento, prettyPrint);
  389.     }
  390.    
  391.     /**
  392.      * Serialize to file system in <var>file</var> the object <var>eccezioneProcessamento</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneProcessamento}
  393.      *
  394.      * @param file Xml file to serialize the object <var>eccezioneProcessamento</var>
  395.      * @param eccezioneProcessamento Object to be serialized in xml file <var>fileName</var>
  396.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  397.      */
  398.     public void write(File file,EccezioneProcessamento eccezioneProcessamento) throws SerializerException {
  399.         this.objToXml(file, EccezioneProcessamento.class, eccezioneProcessamento, false);
  400.     }
  401.     /**
  402.      * Serialize to file system in <var>file</var> the object <var>eccezioneProcessamento</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneProcessamento}
  403.      *
  404.      * @param file Xml file to serialize the object <var>eccezioneProcessamento</var>
  405.      * @param eccezioneProcessamento Object to be serialized in xml file <var>fileName</var>
  406.      * @param prettyPrint if true output the XML with indenting
  407.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  408.      */
  409.     public void write(File file,EccezioneProcessamento eccezioneProcessamento,boolean prettyPrint) throws SerializerException {
  410.         this.objToXml(file, EccezioneProcessamento.class, eccezioneProcessamento, prettyPrint);
  411.     }
  412.    
  413.     /**
  414.      * Serialize to output stream <var>out</var> the object <var>eccezioneProcessamento</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneProcessamento}
  415.      *
  416.      * @param out OutputStream to serialize the object <var>eccezioneProcessamento</var>
  417.      * @param eccezioneProcessamento Object to be serialized in xml file <var>fileName</var>
  418.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  419.      */
  420.     public void write(OutputStream out,EccezioneProcessamento eccezioneProcessamento) throws SerializerException {
  421.         this.objToXml(out, EccezioneProcessamento.class, eccezioneProcessamento, false);
  422.     }
  423.     /**
  424.      * Serialize to output stream <var>out</var> the object <var>eccezioneProcessamento</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneProcessamento}
  425.      *
  426.      * @param out OutputStream to serialize the object <var>eccezioneProcessamento</var>
  427.      * @param eccezioneProcessamento Object to be serialized in xml file <var>fileName</var>
  428.      * @param prettyPrint if true output the XML with indenting
  429.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  430.      */
  431.     public void write(OutputStream out,EccezioneProcessamento eccezioneProcessamento,boolean prettyPrint) throws SerializerException {
  432.         this.objToXml(out, EccezioneProcessamento.class, eccezioneProcessamento, prettyPrint);
  433.     }
  434.            
  435.     /**
  436.      * Serialize to byte array the object <var>eccezioneProcessamento</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneProcessamento}
  437.      *
  438.      * @param eccezioneProcessamento Object to be serialized
  439.      * @return Object to be serialized in byte array
  440.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  441.      */
  442.     public byte[] toByteArray(EccezioneProcessamento eccezioneProcessamento) throws SerializerException {
  443.         return this.objToXml(EccezioneProcessamento.class, eccezioneProcessamento, false).toByteArray();
  444.     }
  445.     /**
  446.      * Serialize to byte array the object <var>eccezioneProcessamento</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneProcessamento}
  447.      *
  448.      * @param eccezioneProcessamento Object to be serialized
  449.      * @param prettyPrint if true output the XML with indenting
  450.      * @return Object to be serialized in byte array
  451.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  452.      */
  453.     public byte[] toByteArray(EccezioneProcessamento eccezioneProcessamento,boolean prettyPrint) throws SerializerException {
  454.         return this.objToXml(EccezioneProcessamento.class, eccezioneProcessamento, prettyPrint).toByteArray();
  455.     }
  456.    
  457.     /**
  458.      * Serialize to String the object <var>eccezioneProcessamento</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneProcessamento}
  459.      *
  460.      * @param eccezioneProcessamento Object to be serialized
  461.      * @return Object to be serialized as String
  462.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  463.      */
  464.     public String toString(EccezioneProcessamento eccezioneProcessamento) throws SerializerException {
  465.         return this.objToXml(EccezioneProcessamento.class, eccezioneProcessamento, false).toString();
  466.     }
  467.     /**
  468.      * Serialize to String the object <var>eccezioneProcessamento</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.EccezioneProcessamento}
  469.      *
  470.      * @param eccezioneProcessamento Object to be serialized
  471.      * @param prettyPrint if true output the XML with indenting
  472.      * @return Object to be serialized as String
  473.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  474.      */
  475.     public String toString(EccezioneProcessamento eccezioneProcessamento,boolean prettyPrint) throws SerializerException {
  476.         return this.objToXml(EccezioneProcessamento.class, eccezioneProcessamento, prettyPrint).toString();
  477.     }
  478.    
  479.    
  480.    
  481.     /*
  482.      =================================================================================
  483.      Object: MessaggioDiErroreApplicativo
  484.      =================================================================================
  485.     */
  486.    
  487.     /**
  488.      * Serialize to file system in <var>fileName</var> the object <var>messaggioDiErroreApplicativo</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.MessaggioDiErroreApplicativo}
  489.      *
  490.      * @param fileName Xml file to serialize the object <var>messaggioDiErroreApplicativo</var>
  491.      * @param messaggioDiErroreApplicativo Object to be serialized in xml file <var>fileName</var>
  492.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  493.      */
  494.     public void write(String fileName,MessaggioDiErroreApplicativo messaggioDiErroreApplicativo) throws SerializerException {
  495.         this.objToXml(fileName, MessaggioDiErroreApplicativo.class, messaggioDiErroreApplicativo, false);
  496.     }
  497.     /**
  498.      * Serialize to file system in <var>fileName</var> the object <var>messaggioDiErroreApplicativo</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.MessaggioDiErroreApplicativo}
  499.      *
  500.      * @param fileName Xml file to serialize the object <var>messaggioDiErroreApplicativo</var>
  501.      * @param messaggioDiErroreApplicativo Object to be serialized in xml file <var>fileName</var>
  502.      * @param prettyPrint if true output the XML with indenting
  503.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  504.      */
  505.     public void write(String fileName,MessaggioDiErroreApplicativo messaggioDiErroreApplicativo,boolean prettyPrint) throws SerializerException {
  506.         this.objToXml(fileName, MessaggioDiErroreApplicativo.class, messaggioDiErroreApplicativo, prettyPrint);
  507.     }
  508.    
  509.     /**
  510.      * Serialize to file system in <var>file</var> the object <var>messaggioDiErroreApplicativo</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.MessaggioDiErroreApplicativo}
  511.      *
  512.      * @param file Xml file to serialize the object <var>messaggioDiErroreApplicativo</var>
  513.      * @param messaggioDiErroreApplicativo Object to be serialized in xml file <var>fileName</var>
  514.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  515.      */
  516.     public void write(File file,MessaggioDiErroreApplicativo messaggioDiErroreApplicativo) throws SerializerException {
  517.         this.objToXml(file, MessaggioDiErroreApplicativo.class, messaggioDiErroreApplicativo, false);
  518.     }
  519.     /**
  520.      * Serialize to file system in <var>file</var> the object <var>messaggioDiErroreApplicativo</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.MessaggioDiErroreApplicativo}
  521.      *
  522.      * @param file Xml file to serialize the object <var>messaggioDiErroreApplicativo</var>
  523.      * @param messaggioDiErroreApplicativo Object to be serialized in xml file <var>fileName</var>
  524.      * @param prettyPrint if true output the XML with indenting
  525.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  526.      */
  527.     public void write(File file,MessaggioDiErroreApplicativo messaggioDiErroreApplicativo,boolean prettyPrint) throws SerializerException {
  528.         this.objToXml(file, MessaggioDiErroreApplicativo.class, messaggioDiErroreApplicativo, prettyPrint);
  529.     }
  530.    
  531.     /**
  532.      * Serialize to output stream <var>out</var> the object <var>messaggioDiErroreApplicativo</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.MessaggioDiErroreApplicativo}
  533.      *
  534.      * @param out OutputStream to serialize the object <var>messaggioDiErroreApplicativo</var>
  535.      * @param messaggioDiErroreApplicativo Object to be serialized in xml file <var>fileName</var>
  536.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  537.      */
  538.     public void write(OutputStream out,MessaggioDiErroreApplicativo messaggioDiErroreApplicativo) throws SerializerException {
  539.         this.objToXml(out, MessaggioDiErroreApplicativo.class, messaggioDiErroreApplicativo, false);
  540.     }
  541.     /**
  542.      * Serialize to output stream <var>out</var> the object <var>messaggioDiErroreApplicativo</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.MessaggioDiErroreApplicativo}
  543.      *
  544.      * @param out OutputStream to serialize the object <var>messaggioDiErroreApplicativo</var>
  545.      * @param messaggioDiErroreApplicativo Object to be serialized in xml file <var>fileName</var>
  546.      * @param prettyPrint if true output the XML with indenting
  547.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  548.      */
  549.     public void write(OutputStream out,MessaggioDiErroreApplicativo messaggioDiErroreApplicativo,boolean prettyPrint) throws SerializerException {
  550.         this.objToXml(out, MessaggioDiErroreApplicativo.class, messaggioDiErroreApplicativo, prettyPrint);
  551.     }
  552.            
  553.     /**
  554.      * Serialize to byte array the object <var>messaggioDiErroreApplicativo</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.MessaggioDiErroreApplicativo}
  555.      *
  556.      * @param messaggioDiErroreApplicativo Object to be serialized
  557.      * @return Object to be serialized in byte array
  558.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  559.      */
  560.     public byte[] toByteArray(MessaggioDiErroreApplicativo messaggioDiErroreApplicativo) throws SerializerException {
  561.         return this.objToXml(MessaggioDiErroreApplicativo.class, messaggioDiErroreApplicativo, false).toByteArray();
  562.     }
  563.     /**
  564.      * Serialize to byte array the object <var>messaggioDiErroreApplicativo</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.MessaggioDiErroreApplicativo}
  565.      *
  566.      * @param messaggioDiErroreApplicativo Object to be serialized
  567.      * @param prettyPrint if true output the XML with indenting
  568.      * @return Object to be serialized in byte array
  569.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  570.      */
  571.     public byte[] toByteArray(MessaggioDiErroreApplicativo messaggioDiErroreApplicativo,boolean prettyPrint) throws SerializerException {
  572.         return this.objToXml(MessaggioDiErroreApplicativo.class, messaggioDiErroreApplicativo, prettyPrint).toByteArray();
  573.     }
  574.    
  575.     /**
  576.      * Serialize to String the object <var>messaggioDiErroreApplicativo</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.MessaggioDiErroreApplicativo}
  577.      *
  578.      * @param messaggioDiErroreApplicativo Object to be serialized
  579.      * @return Object to be serialized as String
  580.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  581.      */
  582.     public String toString(MessaggioDiErroreApplicativo messaggioDiErroreApplicativo) throws SerializerException {
  583.         return this.objToXml(MessaggioDiErroreApplicativo.class, messaggioDiErroreApplicativo, false).toString();
  584.     }
  585.     /**
  586.      * Serialize to String the object <var>messaggioDiErroreApplicativo</var> of type {@link it.cnipa.schemas._2003.egovit.exception1_0.MessaggioDiErroreApplicativo}
  587.      *
  588.      * @param messaggioDiErroreApplicativo Object to be serialized
  589.      * @param prettyPrint if true output the XML with indenting
  590.      * @return Object to be serialized as String
  591.      * @throws SerializerException The exception that is thrown when an error occurs during serialization
  592.      */
  593.     public String toString(MessaggioDiErroreApplicativo messaggioDiErroreApplicativo,boolean prettyPrint) throws SerializerException {
  594.         return this.objToXml(MessaggioDiErroreApplicativo.class, messaggioDiErroreApplicativo, prettyPrint).toString();
  595.     }
  596.    
  597.    
  598.    

  599. }