CreatePersistor() public static method

Create a persistor object. These objects know how to persist certain types of classes.
public static CreatePersistor ( String className ) : IPersistor
className String The name of the class to create a persistor for.
return IPersistor
        /// <summary>
        /// Process any synapses that should be loaded.
        /// </summary>
        /// <param name="xmlIn">The XML reader.</param>
        private void HandleSynapses(ReadXML xmlIn)
        {
            String end = xmlIn.LastTag.Name;

            while (xmlIn.ReadToTag())
            {
                if (xmlIn.IsIt(BasicNetworkPersistor.TAG_SYNAPSE, true))
                {
                    int from = xmlIn.LastTag.GetAttributeInt(
                        BasicNetworkPersistor.ATTRIBUTE_FROM);
                    int to = xmlIn.LastTag.GetAttributeInt(
                        BasicNetworkPersistor.ATTRIBUTE_TO);
                    xmlIn.ReadToTag();
                    IPersistor persistor = PersistorUtil.CreatePersistor(xmlIn
                                                                         .LastTag.Name);
                    ISynapse synapse = (ISynapse)persistor.Load(xmlIn);
                    synapse.FromLayer = this.index2layer[from];
                    synapse.ToLayer   = this.index2layer[to];
                    synapse.FromLayer.AddSynapse(synapse);
                }
                if (xmlIn.IsIt(end, false))
                {
                    break;
                }
            }
        }
        /// <summary>
        /// Handle any layers that should be loaded.
        /// </summary>
        /// <param name="xmlIn">The XML reader.</param>
        private void HandleLayers(ReadXML xmlIn)
        {
            String end = xmlIn.LastTag.Name;

            while (xmlIn.ReadToTag())
            {
                if (xmlIn.IsIt(BasicNetworkPersistor.TAG_LAYER, true))
                {
                    int num = xmlIn.LastTag.GetAttributeInt(
                        BasicNetworkPersistor.ATTRIBUTE_ID);
                    String type = xmlIn.LastTag.GetAttributeValue(
                        BasicNetworkPersistor.ATTRIBUTE_TYPE);
                    xmlIn.ReadToTag();
                    IPersistor persistor = PersistorUtil.CreatePersistor(xmlIn
                                                                         .LastTag.Name);
                    ILayer layer = (ILayer)persistor.Load(xmlIn);
                    this.index2layer[num] = layer;

                    // the type attribute is actually "legacy", but if its there
                    // then use it!
                    if (type != null)
                    {
                        if (type.Equals(BasicNetworkPersistor.ATTRIBUTE_TYPE_INPUT))
                        {
                            this.currentNetwork.TagLayer(BasicNetwork.TAG_INPUT,
                                                         layer);
                        }
                        else if (type
                                 .Equals(BasicNetworkPersistor.ATTRIBUTE_TYPE_OUTPUT))
                        {
                            this.currentNetwork.TagLayer(BasicNetwork.TAG_OUTPUT,
                                                         layer);
                        }
                        else if (type
                                 .Equals(BasicNetworkPersistor.ATTRIBUTE_TYPE_BOTH))
                        {
                            this.currentNetwork.TagLayer(BasicNetwork.TAG_INPUT,
                                                         layer);
                            this.currentNetwork.TagLayer(BasicNetwork.TAG_OUTPUT,
                                                         layer);
                        }
                    }
                    // end of legacy processing
                }
                if (xmlIn.IsIt(end, false))
                {
                    break;
                }
            }
        }