Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

RequiredAttributeObjectPostProcessor Class

A IObjectPostProcessor implementation that enforces required properties to have been configured. Required properties are detected through an attribute, by default, Spring's RequiredAttribute attribute.

For a list of all members of this type, see RequiredAttributeObjectPostProcessor Members .

System.Object
   InstantiationAwareObjectPostProcessorAdapter
      RequiredAttributeObjectPostProcessor

[Visual Basic]
Public Class RequiredAttributeObjectPostProcessor
    Inherits InstantiationAwareObjectPostProcessorAdapter
[C#]
public class RequiredAttributeObjectPostProcessor : InstantiationAwareObjectPostProcessorAdapter

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

The motivation for the existence of this IObjectPostProcessor is to allow developers to annotate the setter properties of their own classes with an arbitrary attribute to indicate that the container must check for the configuration of a dependency injected value. This neatly pushes responsibility for such checking onto the container (where it arguably belongs), and obviates the need (in part) for a developer to code a method that simply checks that all required properties have actually been set.

Please note that an 'init' method may still need to implemented (and may still be desirable), because all that this class does is enforce that a 'required' property has actually been configured with a value. It does not check anything else... In particular, it does not check that a configured value is not

null
.

Requirements

Namespace: Spring.Objects.Factory.Attributes

Assembly: Spring.Core (in Spring.Core.dll)

See Also

RequiredAttributeObjectPostProcessor Members | Spring.Objects.Factory.Attributes Namespace