private void ApplyDefaults(DocumentDefaultsDefinition defaults) { if (defaults == null) return; bool lazyInit = false; bool.TryParse(defaults.LazyInit, out lazyInit); IsLazyInit = lazyInit; }
/// <summary> /// Creates a GenericObjectDefinition that applies the default values provided /// in the XML Spring config document. Additionally parses the specific class /// attributesthat allows the definition of LazyInit, Scope or Qualifier /// </summary> /// <param name="typeOfObject">Type of scanned component</param> /// <param name="defaults">Defualts provided in Spring Config document</param> public ScannedGenericObjectDefinition(Type typeOfObject, DocumentDefaultsDefinition defaults) { ObjectType = typeOfObject; ParseName(); ApplyDefaults(defaults); ParseScopeAttribute(); ParseLazyAttribute(); ParseQualifierAttribute(); }
/// <summary> /// Creates a GenericObjectDefinition that applies the default values provided /// in the XML Spring config document. Additionally parses the specific class /// attributesthat allows the definition of LazyInit, Scope or Qualifier /// </summary> /// <param name="typeOfObject">Type of scanned component</param> /// <param name="defaults">Defualts provided in Spring Config document</param> public ScannedGenericObjectDefinition(Type typeOfObject, DocumentDefaultsDefinition defaults) { ObjectType = typeOfObject; ParseName(); ApplyDefaults(defaults); ParseLazyAttribute(); ParseScopeAttribute(); ParseQualifierAttribute(); Log.Debug(m => m("ComponentName: {0}; {1}", _componentName, ToString())); }
private void ApplyDefaults(DocumentDefaultsDefinition defaults) { if (defaults == null) return; bool lazyInit = false; bool.TryParse(defaults.LazyInit, out lazyInit); IsLazyInit = lazyInit; if (!String.IsNullOrEmpty(defaults.Autowire)) { AutowireMode = GetAutowireMode(defaults.Autowire); } }
/// <summary> /// Initialize the default lazy-init, dependency check, and autowire settings. /// </summary> /// <param name="root">The root element</param> public void InitDefaults(XmlElement root) { DocumentDefaultsDefinition ddd = new DocumentDefaultsDefinition(); #region Instrumentation if (log.IsDebugEnabled) { log.Debug("Loading object definitions..."); } #endregion ddd.LazyInit = GetAttributeValue(root, ObjectDefinitionConstants.DefaultLazyInitAttribute); #region Instrumentation if (log.IsDebugEnabled) { log.Debug( string.Format( "Default lazy init '{0}'.", ddd.LazyInit)); } #endregion ddd.DependencyCheck = GetAttributeValue(root, ObjectDefinitionConstants.DefaultDependencyCheckAttribute); #region Instrumentation if (log.IsDebugEnabled) { log.Debug( string.Format( "Default dependency check '{0}'.", ddd.DependencyCheck)); } #endregion ddd.Autowire = GetAttributeValue(root, ObjectDefinitionConstants.DefaultAutowireAttribute); #region Instrumentation if (log.IsDebugEnabled) { log.Debug( string.Format( "Default autowire '{0}'.", ddd.Autowire)); } #endregion ddd.Merge = GetAttributeValue(root, ObjectDefinitionConstants.DefaultMergeAttribute); #region Instrumentation if (log.IsDebugEnabled) { log.Debug( string.Format( "Default merge '{0}'.", ddd.Merge)); } #endregion defaults = ddd; }
/// <summary> /// Initialize the default lazy-init, dependency check, and autowire settings. /// </summary> /// <param name="root">The root element</param> public void InitDefaults(XmlElement root) { DocumentDefaultsDefinition ddd = new DocumentDefaultsDefinition(); #region Instrumentation if (log.IsDebugEnabled) { log.Debug("Loading object definitions..."); } #endregion ddd.LazyInit = GetAttributeValue(root, ObjectDefinitionConstants.DefaultLazyInitAttribute); #region Instrumentation if (log.IsDebugEnabled) { log.Debug( string.Format( "Default lazy init '{0}'.", ddd.LazyInit)); } #endregion ddd.DependencyCheck = GetAttributeValue(root, ObjectDefinitionConstants.DefaultDependencyCheckAttribute); #region Instrumentation if (log.IsDebugEnabled) { log.Debug( string.Format( "Default dependency check '{0}'.", ddd.DependencyCheck)); } #endregion ddd.Autowire = GetAttributeValue(root, ObjectDefinitionConstants.DefaultAutowireAttribute); #region Instrumentation if (log.IsDebugEnabled) { log.Debug( string.Format( "Default autowire '{0}'.", ddd.Autowire)); } #endregion ddd.Merge = GetAttributeValue(root, ObjectDefinitionConstants.DefaultMergeAttribute); #region Instrumentation if (log.IsDebugEnabled) { log.Debug( string.Format( "Default merge '{0}'.", ddd.Merge)); } #endregion ddd.AutowireCandidates = GetAttributeValue(root, ObjectDefinitionConstants.DefaultAutowireCandidatesAttribute); #region Instrumentation if (log.IsDebugEnabled) { log.Debug( string.Format( "Default init method '{0}'.", ddd.InitMethod)); } #endregion ddd.DestroyMethod = GetAttributeValue(root, ObjectDefinitionConstants.DefaultDestroyMethodAttribute); #region Instrumentation if (log.IsDebugEnabled) { log.Debug( string.Format( "Default destroy method '{0}'.", ddd.DestroyMethod)); } #endregion ddd.AutowireCandidates = GetAttributeValue(root, ObjectDefinitionConstants.DefaultAutowireCandidatesAttribute); #region Instrumentation if (log.IsDebugEnabled) { log.Debug( string.Format( "Default autowire candidates '{0}'.", ddd.AutowireCandidates)); } #endregion ddd.InitMethod = GetAttributeValue(root, ObjectDefinitionConstants.DefaultInitMethodAttribute); #region Instrumentation if (log.IsDebugEnabled) { log.Debug( string.Format( "Default init method '{0}'.", ddd.InitMethod)); } #endregion ddd.DestroyMethod = GetAttributeValue(root, ObjectDefinitionConstants.DefaultDestroyMethodAttribute); #region Instrumentation if (log.IsDebugEnabled) { log.Debug( string.Format( "Default destroy method '{0}'.", ddd.DestroyMethod)); } #endregion defaults = ddd; }