/// <summary>
        /// Scans for types using the provided scanner.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="scanner">The scanner.</param>
        public static void Scan(this GenericApplicationContext context, AssemblyObjectDefinitionScanner scanner)
        {
            var registry = context.ObjectFactory as IObjectDefinitionRegistry;

            scanner.ScanAndRegisterTypes(registry);

            AttributeConfigUtils.RegisterAttributeConfigProcessors(registry);
        }
        /// <summary>
        /// Parse the specified XmlElement and register the resulting
        /// ObjectDefinitions with the <see cref="P:Spring.Objects.Factory.Xml.ParserContext.Registry"/> IObjectDefinitionRegistry
        /// embedded in the supplied <see cref="T:Spring.Objects.Factory.Xml.ParserContext"/>
        /// </summary>
        /// <param name="element">The element to be parsed.</param>
        /// <param name="parserContext">The object encapsulating the current state of the parsing process.
        /// Provides access to a IObjectDefinitionRegistry</param>
        /// <returns>The primary object definition.</returns>
        /// <remarks>
        ///     <p>
        /// This method is never invoked if the parser is namespace aware
        /// and was called to process the root node.
        /// </p>
        /// </remarks>
        public IObjectDefinition ParseElement(XmlElement element, ParserContext parserContext)
        {
            IObjectDefinitionRegistry registry = parserContext.ReaderContext.Registry;

            AssertUtils.ArgumentNotNull(registry, "registry");

            AttributeConfigUtils.RegisterAttributeConfigProcessors(registry);

            return(null);
        }
Пример #3
0
        private void RegisterComponents(XmlElement element, IObjectDefinitionRegistry registry)
        {
            bool attributeConfig = true;
            var  attr            = element.GetAttribute(ATTRIBUTE_CONFIG_ATTRIBUTE);

            if (attr != null)
            {
                bool.TryParse(attr, out attributeConfig);
            }
            if (attributeConfig)
            {
                AttributeConfigUtils.RegisterAttributeConfigProcessors(registry);
            }
        }