C# Class Spring.Objects.Factory.Support.ObjectDefinitionValueResolver

Helper class for use in object factory implementations, resolving values contained in object definition objects into the actual values applied to the target object instance.
Used by AbstractAutowireCapableObjectFactory.
Exibir arquivo Open project: spring-projects/spring-net Class Usage Examples

Public Methods

Method Description
ObjectDefinitionValueResolver ( Spring.Objects.Factory.Support.AbstractObjectFactory objectFactory ) : System

Initializes a new instance of the ObjectDefinitionValueResolver class.

ResolveValueIfNecessary ( string name, IObjectDefinition definition, string argumentName, object argumentValue ) : object

Given a property value, return a value, resolving any references to other objects in the factory if necessary.

The value could be :

An Spring.Objects.Factory.Config.IObjectDefinition, which leads to the creation of a corresponding new object instance. Singleton flags and names of such "inner objects" are always ignored: inner objects are anonymous prototypes.

A Spring.Objects.Factory.Config.RuntimeObjectReference, which must be resolved.

An Spring.Objects.Factory.Config.IManagedCollection. This is a special placeholder collection that may contain Spring.Objects.Factory.Config.RuntimeObjectReferences or collections that will need to be resolved.

An ordinary object or , in which case it's left alone.

Protected Methods

Method Description
ResolveInnerObjectDefinition ( string name, string innerObjectName, string argumentName, IObjectDefinition definition, bool singletonOwner ) : object

Resolves an inner object definition.

ResolveReference ( IObjectDefinition definition, string name, string argumentName, Spring.Objects.Factory.Config.RuntimeObjectReference reference ) : object

Resolve a reference to another object in the factory.

ResolveTargetType ( Spring.Objects.Factory.Config.TypedStringValue value ) : Type

Resolve the target type of the passed TypedStringValue.

Private Methods

Method Description
AdaptInnerObjectName ( string innerObjectName ) : string

Checks the given bean name whether it is unique. If not already unique, a counter is added, increasing the counter until the name is unique.

ResolvePropertyValue ( string name, IObjectDefinition definition, string argumentName, object argumentValue ) : object

TODO

Method Details

ObjectDefinitionValueResolver() public method

Initializes a new instance of the ObjectDefinitionValueResolver class.
public ObjectDefinitionValueResolver ( Spring.Objects.Factory.Support.AbstractObjectFactory objectFactory ) : System
objectFactory Spring.Objects.Factory.Support.AbstractObjectFactory The object factory.
return System

ResolveInnerObjectDefinition() protected method

Resolves an inner object definition.
protected ResolveInnerObjectDefinition ( string name, string innerObjectName, string argumentName, IObjectDefinition definition, bool singletonOwner ) : object
name string /// The name of the object that surrounds this inner object definition. ///
innerObjectName string /// The name of the inner object definition... note: this is a synthetic /// name assigned by the factory (since it makes no sense for inner object /// definitions to have names). ///
argumentName string /// The name of the property the value of which is being resolved. ///
definition IObjectDefinition /// The definition of the inner object that is to be resolved. ///
singletonOwner bool /// if the owner of the property is a singleton. ///
return object

ResolveReference() protected method

Resolve a reference to another object in the factory.
protected ResolveReference ( IObjectDefinition definition, string name, string argumentName, Spring.Objects.Factory.Config.RuntimeObjectReference reference ) : object
definition IObjectDefinition /// The definition of the named object. ///
name string /// The name of the object that is having the value of one of its properties resolved. ///
argumentName string /// The name of the property the value of which is being resolved. ///
reference Spring.Objects.Factory.Config.RuntimeObjectReference /// The runtime reference containing the value of the property. ///
return object

ResolveTargetType() protected method

Resolve the target type of the passed TypedStringValue.
protected ResolveTargetType ( Spring.Objects.Factory.Config.TypedStringValue value ) : Type
value Spring.Objects.Factory.Config.TypedStringValue The who's target type is to be resolved
return System.Type

ResolveValueIfNecessary() public method

Given a property value, return a value, resolving any references to other objects in the factory if necessary.

The value could be :

An Spring.Objects.Factory.Config.IObjectDefinition, which leads to the creation of a corresponding new object instance. Singleton flags and names of such "inner objects" are always ignored: inner objects are anonymous prototypes.

A Spring.Objects.Factory.Config.RuntimeObjectReference, which must be resolved.

An Spring.Objects.Factory.Config.IManagedCollection. This is a special placeholder collection that may contain Spring.Objects.Factory.Config.RuntimeObjectReferences or collections that will need to be resolved.

An ordinary object or , in which case it's left alone.

public ResolveValueIfNecessary ( string name, IObjectDefinition definition, string argumentName, object argumentValue ) : object
name string /// The name of the object that is having the value of one of its properties resolved. ///
definition IObjectDefinition /// The definition of the named object. ///
argumentName string /// The name of the property the value of which is being resolved. ///
argumentValue object /// The value of the property that is being resolved. ///
return object