コード例 #1
0
        private void InitDocumentBuilders(Configuration cfg, Analyzer analyzer)
        {
            DirectoryProviderFactory factory = new DirectoryProviderFactory();
            var classMappings = this.mapping.Build(cfg);

            foreach (var classMapping in classMappings)
            {
                System.Type mappedClass = classMapping.MappedClass;
                DirectoryProviderFactory.DirectoryProviders providers =
                    factory.CreateDirectoryProviders(classMapping, cfg, this);

                DocumentBuilder documentBuilder = new DocumentBuilder(classMapping, analyzer, providers.Providers, providers.SelectionStrategy);

                documentBuilders[mappedClass] = documentBuilder;
                BindFilterDefs(classMapping);
            }
            factory.StartDirectoryProviders();
        }
コード例 #2
0
        private void InitDocumentBuilders(Configuration cfg, Analyzer analyzer)
        {
            DirectoryProviderFactory factory = new DirectoryProviderFactory();
            foreach (PersistentClass clazz in cfg.ClassMappings)
            {
                System.Type mappedClass = clazz.MappedClass;
                if (mappedClass != null)
                {
                    if (AttributeUtil.HasAttribute<IndexedAttribute>(mappedClass))
                    {
                        DirectoryProviderFactory.DirectoryProviders providers =
                            factory.CreateDirectoryProviders(mappedClass, cfg, this);

                        DocumentBuilder documentBuilder = new DocumentBuilder(mappedClass, analyzer, providers.Providers, providers.SelectionStrategy);

                        documentBuilders[mappedClass] = documentBuilder;
                    }
                    BindFilterDefs(mappedClass);
                }
            }
            factory.StartDirectoryProviders();
        }