gt:         switch (this.serializeMode) {
context: /*
   * Decompiled with CFR 0_114.
   * 
   * Could not load the following classes:
   *  com.stimulsoft.lib.utils.StiXmlUtil
   */
  package com.stimulsoft.base.serializing;
  
  import com.stimulsoft.base.serializing.CounterReference;
  import com.stimulsoft.base.serializing.SerializeMode;
  import com.stimulsoft.base.serializing.StiBranch;
  import com.stimulsoft.base.serializing.StiSerializerDocument;
  import com.stimulsoft.base.serializing.StiSerializerReport;
  import com.stimulsoft.base.serializing.StiSerializerToXmlString;
  import com.stimulsoft.base.serializing.UndefinedReference;
  import com.stimulsoft.base.serializing.interfaceobject.IStiSerializable;
  import com.stimulsoft.base.serializing.interfaceobject.IStiSerializableRef;
  import com.stimulsoft.base.serializing.xmlelements.BaseElement;
  import com.stimulsoft.base.serializing.xmlelements.XMLSerializerRootElement;
  import com.stimulsoft.lib.utils.StiXmlUtil;
  import java.io.File;
  import java.io.IOException;
  import java.io.OutputStream;
  import java.util.ArrayList;
  import java.util.Hashtable;
  import java.util.List;
  import java.util.Map;
  import javax.xml.parsers.DocumentBuilder;
  import javax.xml.parsers.DocumentBuilderFactory;
  import javax.xml.parsers.ParserConfigurationException;
  import javax.xml.transform.TransformerException;
  import org.w3c.dom.Document;
  import org.w3c.dom.Element;
  import org.w3c.dom.Node;
  import org.w3c.dom.Text;
  
  /*
   * This class specifies class file version 49.0 but uses Java 6 signatures.  Assumed Java 6.
   */
  public class StiSerializerControler {
      private final Document document;
      private final UndefinedReference undefinedReference = new UndefinedReference();
      private final CounterReference counterReference = new CounterReference();
      private final SerializeMode serializeMode;
      private Hashtable<String, Object> memoryStore = new Hashtable();
  
      private StiSerializerControler(SerializeMode serializeMode) throws ParserConfigurationException {
          this.serializeMode = serializeMode;
          DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
          DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
          this.document = documentBuilder.newDocument();
      }
  
      public Element createElement(String string) {
          try {
              return this.document.createElement(string);
          }
          catch (Exception var2_2) {
              throw new RuntimeException("\u041d\u0435\u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c Xml \u044d\u043b\u0435\u043c\u0435\u043d\u0442 '" + string + "'", var2_2);
          }
      }
  
      public void addUndefinedRef(Element element, IStiSerializableRef iStiSerializableRef) {
          this.undefinedReference.add(element, iStiSerializableRef);
      }
  
      public void addUndefinedRef(BaseElement baseElement, IStiSerializableRef iStiSerializableRef) {
          this.undefinedReference.add(baseElement.getXmlElement(), iStiSerializableRef);
      }
  
      private int getNextReference() {
          return this.counterReference.getNextReference();
      }
  
      public Text createTextNode(String string) {
          return this.document.createTextNode(string);
      }
  
      public static void serializeReport(IStiSerializableRef iStiSerializableRef, File file) {
          StiSerializerControler.serializeReport(iStiSerializableRef, file.getAbsolutePath());
      }
  
      public static void serializeReport(IStiSerializableRef iStiSerializableRef, String string) {
          try {
              StiSerializerControler stiSerializerControler = StiSerializerControler.serializeRep(iStiSerializableRef);
              stiSerializerControler.saveResult(string, false);
          }
          catch (Exception var2_3) {
              throw new RuntimeException(var2_3);
          }
      }
  
      public static Hashtable<String, Object> serializeReport(IStiSerializableRef iStiSerializableRef, OutputStream outputStream, boolean bl) {
          try {
              StiSerializerControler stiSerializerControler = StiSerializerControler.serializeRep(iStiSerializableRef);
              stiSerializerControler.saveResult(outputStream, bl);
              return stiSerializerControler.memoryStore;
          }
          catch (Exception var3_4) {
              throw new RuntimeException(var3_4);
          }
      }
  
      private static StiSerializerControler serializeRep(IStiSerializableRef iStiSerializableRef) {
          ArrayList<IStiSerializableRef> arrayList = new ArrayList<IStiSerializableRef>();
          try {
              StiSerializerControler stiSerializerControler = new StiSerializerControler(SerializeMode.report);
              StiBranch stiBranch = stiSerializerControler.getRootElement("StiReport", null).createNewBranch();
              stiSerializerControler.document.appendChild(stiBranch.getRootElement());
              StiSerializerReport stiSerializerReport = new StiSerializerReport(stiSerializerControler, stiBranch, iStiSerializableRef);
              stiSerializerReport.serialize(arrayList);
              stiSerializerControler.undefinedReference.updateReference();
              stiSerializerControler.memoryStore.putAll(stiSerializerReport.getMemoryStore());
              StiSerializerControler stiSerializerControler2 = stiSerializerControler;
              return stiSerializerControler2;
          }
          catch (Exception var2_3) {
              throw new RuntimeException(var2_3);
          }
          finally {
              StiSerializerControler.resetRefs(arrayList);
          }
      }
  
      public static void serializeDocument(IStiSerializableRef iStiSerializableRef, File file, boolean bl) {
          StiSerializerControler.serializeDocument(iStiSerializableRef, file.getAbsolutePath(), bl);
      }
  
      public static void serializeDocument(IStiSerializableRef iStiSerializableRef, String string, boolean bl) {
          ArrayList<IStiSerializableRef> arrayList = new ArrayList<IStiSerializableRef>();
          try {
              StiSerializerControler stiSerializerControler = new StiSerializerControler(SerializeMode.document);
              StiBranch stiBranch = stiSerializerControler.getRootElement("StiDocument", null).createNewBranch();
              stiSerializerControler.document.appendChild(stiBranch.getRootElement());
              new StiSerializerDocument(stiSerializerControler, stiBranch, iStiSerializableRef).serialize(arrayList);
              stiSerializerControler.undefinedReference.updateReference();
              stiSerializerControler.saveResult(string, bl);
          }
          catch (Exception var4_5) {
              throw new RuntimeException(var4_5);
          }
          finally {
              StiSerializerControler.resetRefs(arrayList);
          }
      }
  
      public static void serializeDocument(IStiSerializableRef iStiSerializableRef, OutputStream outputStream) {
          StiSerializerControler.serializeDocument(iStiSerializableRef, null, outputStream, false);
      }
  
      public static void serializeDocument(IStiSerializableRef iStiSerializableRef, OutputStream outputStream, boolean bl) {
          StiSerializerControler.serializeDocument(iStiSerializableRef, null, outputStream, bl);
      }
  
      public static void serializeDocument(IStiSerializableRef iStiSerializableRef, String string, OutputStream outputStream) {
          StiSerializerControler.serializeDocument(iStiSerializableRef, string, outputStream, false);
      }
  
      public static void serializeDocument(IStiSerializableRef iStiSerializableRef, String string, OutputStream outputStream, boolean bl) {
          ArrayList<IStiSerializableRef> arrayList = new ArrayList<IStiSerializableRef>();
          try {
              StiSerializerControler stiSerializerControler = new StiSerializerControler(SerializeMode.document);
              StiBranch stiBranch = stiSerializerControler.getRootElement("StiDocument", string).createNewBranch();
              stiSerializerControler.document.appendChild(stiBranch.getRootElement());
              new StiSerializerDocument(stiSerializerControler, stiBranch, iStiSerializableRef).serialize(arrayList);
              stiSerializerControler.undefinedReference.updateReference();
              stiSerializerControler.saveResult(outputStream, bl);
          }
          catch (Exception var5_6) {
              throw new RuntimeException(var5_6);
          }
          finally {
              StiSerializerControler.resetRefs(arrayList);
          }
      }
  
      private static void resetRefs(List<IStiSerializableRef> list) {
          for (IStiSerializableRef iStiSerializableRef : list) {
              iStiSerializableRef.setReference(-1);
          }
      }
  
      public static String serializedObjectAsString(IStiSerializable iStiSerializable) {
          ArrayList<IStiSerializableRef> arrayList = new ArrayList<IStiSerializableRef>();
          try {
              StiSerializerControler stiSerializerControler = new StiSerializerControler(SerializeMode.xmlString);
              StiBranch stiBranch = stiSerializerControler.getRootElement("State", null).createNewBranch();
              stiSerializerControler.document.appendChild(stiBranch.getRootElement());
              new StiSerializerToXmlString(stiSerializerControler, stiBranch, iStiSerializable).serialize(arrayList);
              stiSerializerControler.undefinedReference.updateReference();
              String string = StiXmlUtil.convertXMLFileToString((Document)stiSerializerControler.document);
              return string;
          }
          catch (Exception var2_3) {
              throw new RuntimeException(var2_3);
          }
          finally {
              StiSerializerControler.resetRefs(arrayList);
          }
      }
  
      private XMLSerializerRootElement getRootElement(String string, String string2) {
          return new XMLSerializerRootElement(this, string, string2);
      }
  
      private void saveResult(String string, boolean bl) throws IOException, TransformerException {
          StiXmlUtil.saveDocumentInFile((Document)this.document, (String)string, (boolean)bl);
      }
  
      private void saveResult(OutputStream outputStream, boolean bl) throws IOException, TransformerException {
          StiXmlUtil.xmlDocumentToOutputStream((Document)this.document, (OutputStream)outputStream, (boolean)bl);
      }
  
      public void setNextReferenceForParent(IStiSerializableRef iStiSerializableRef, List<IStiSerializableRef> list) {
          iStiSerializableRef.setReference(this.getNextReference());
          list.add(iStiSerializableRef);
      }
  
      public void serializeBranch(StiBranch stiBranch, IStiSerializableRef iStiSerializableRef, List<IStiSerializableRef> list) {
  