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

Programmatic means of constructing a IObjectDefinition using the builder pattern. Intended primarily for use when implementing custom namespace parsers.
Set methods are used instead of properties, so that chaining of methods can be used to create 'one-liner'definitions that set multiple properties at one.
Show file Open project: spring-projects/spring-net Class Usage Examples

Public Methods

Method Description
AddConstructorArg ( object value ) : ObjectDefinitionBuilder

Adds an index constructor arg value. The current index is tracked internally and all addtions are at the present point

AddConstructorArgReference ( string objectName ) : ObjectDefinitionBuilder

Adds a reference to the named object as a constructor argument.

AddDependsOn ( string objectName ) : ObjectDefinitionBuilder

Adds the specified object name to the list of objects that this definition depends on.

AddPropertyReference ( string name, string objectName ) : ObjectDefinitionBuilder

Adds a reference to the specified object name under the property specified.

AddPropertyValue ( string name, object value ) : ObjectDefinitionBuilder

Adds the property value under the given name.

ChildObjectDefinition ( IObjectDefinitionFactory objectDefinitionFactory, string parentObjectName ) : ObjectDefinitionBuilder

Create a new ObjectDefinitionBuilder used to construct a child object definition..

GenericObjectDefinition ( ) : ObjectDefinitionBuilder

Creates a new ObjectDefinitionBuilder used to construct a Spring.Objects.Factory.Support.GenericObjectDefinition.

GenericObjectDefinition ( Type objectType ) : ObjectDefinitionBuilder

Creates a new ObjectDefinitionBuilder used to construct a Spring.Objects.Factory.Support.GenericObjectDefinition.

GenericObjectDefinition ( string objectTypeName ) : ObjectDefinitionBuilder

Creates a new ObjectDefinitionBuilder used to construct a Spring.Objects.Factory.Support.GenericObjectDefinition.

RootObjectDefinition ( IObjectDefinitionFactory objectDefinitionFactory, Type objectType ) : ObjectDefinitionBuilder

Create a new ObjectDefinitionBuilder used to construct a root object definition.

RootObjectDefinition ( IObjectDefinitionFactory objectDefinitionFactory, Type objectType, string factoryMethodName ) : ObjectDefinitionBuilder

Create a new ObjectDefinitionBuilder used to construct a root object definition.

RootObjectDefinition ( IObjectDefinitionFactory objectDefinitionFactory, string objectTypeName ) : ObjectDefinitionBuilder

Create a new ObjectDefinitionBuilder used to construct a root object definition.

RootObjectDefinition ( IObjectDefinitionFactory objectDefinitionFactory, string objectTypeName, string factoryMethodName ) : ObjectDefinitionBuilder

Create a new ObjectDefinitionBuilder used to construct a root object definition.

SetAbstract ( bool flag ) : ObjectDefinitionBuilder

Sets whether objects or not this definition is abstract.

SetAutowireCandidate ( bool autowireCandidate ) : ObjectDefinitionBuilder

Sets the autowire candidate value for this definition.

SetAutowireMode ( AutoWiringMode autowireMode ) : ObjectDefinitionBuilder

Sets the autowire mode for this definition.

SetDependencyCheck ( DependencyCheckingMode dependencyCheck ) : ObjectDefinitionBuilder

Sets the dependency check mode for this definition.

SetDestroyMethodName ( string methodName ) : ObjectDefinitionBuilder

Sets the name of the destroy method for this definition.

SetFactoryMethod ( string factoryMethod ) : ObjectDefinitionBuilder

Sets the name of the factory method to use for this definition.

SetFactoryObject ( string factoryObject, string factoryMethod ) : ObjectDefinitionBuilder

Sets the name of the factory object to use for this definition.

SetInitMethodName ( string methodName ) : ObjectDefinitionBuilder

Sets the name of the init method for this definition.

SetLazyInit ( bool lazy ) : ObjectDefinitionBuilder

Sets whether objects for this definition should be lazily initialized or not.

SetPrimary ( bool primary ) : ObjectDefinitionBuilder

Sets the primary value for this definition.

SetResourceDescription ( string resourceDescription ) : ObjectDefinitionBuilder

Sets the resource description for this definition.

SetSingleton ( bool singleton ) : ObjectDefinitionBuilder

Sets whether or not this definition describes a singleton object.

Private Methods

Method Description
ObjectDefinitionBuilder ( ) : System

Initializes a new instance of the ObjectDefinitionBuilder class, private to force use of factory methods.

Method Details

AddConstructorArg() public method

Adds an index constructor arg value. The current index is tracked internally and all addtions are at the present point
public AddConstructorArg ( object value ) : ObjectDefinitionBuilder
value object The constructor arg value.
return ObjectDefinitionBuilder

AddConstructorArgReference() public method

Adds a reference to the named object as a constructor argument.
public AddConstructorArgReference ( string objectName ) : ObjectDefinitionBuilder
objectName string Name of the object.
return ObjectDefinitionBuilder

AddDependsOn() public method

Adds the specified object name to the list of objects that this definition depends on.
public AddDependsOn ( string objectName ) : ObjectDefinitionBuilder
objectName string Name of the object.
return ObjectDefinitionBuilder

AddPropertyReference() public method

Adds a reference to the specified object name under the property specified.
public AddPropertyReference ( string name, string objectName ) : ObjectDefinitionBuilder
name string The name.
objectName string Name of the object.
return ObjectDefinitionBuilder

AddPropertyValue() public method

Adds the property value under the given name.
public AddPropertyValue ( string name, object value ) : ObjectDefinitionBuilder
name string The name.
value object The value.
return ObjectDefinitionBuilder

ChildObjectDefinition() public static method

Create a new ObjectDefinitionBuilder used to construct a child object definition..
public static ChildObjectDefinition ( IObjectDefinitionFactory objectDefinitionFactory, string parentObjectName ) : ObjectDefinitionBuilder
objectDefinitionFactory IObjectDefinitionFactory The object definition factory.
parentObjectName string Name of the parent object.
return ObjectDefinitionBuilder

GenericObjectDefinition() public static method

Creates a new ObjectDefinitionBuilder used to construct a Spring.Objects.Factory.Support.GenericObjectDefinition.
public static GenericObjectDefinition ( ) : ObjectDefinitionBuilder
return ObjectDefinitionBuilder

GenericObjectDefinition() public static method

Creates a new ObjectDefinitionBuilder used to construct a Spring.Objects.Factory.Support.GenericObjectDefinition.
public static GenericObjectDefinition ( Type objectType ) : ObjectDefinitionBuilder
objectType System.Type the of the object that the definition is being created for
return ObjectDefinitionBuilder

GenericObjectDefinition() public static method

Creates a new ObjectDefinitionBuilder used to construct a Spring.Objects.Factory.Support.GenericObjectDefinition.
public static GenericObjectDefinition ( string objectTypeName ) : ObjectDefinitionBuilder
objectTypeName string the name of the of the object that the definition is being created for
return ObjectDefinitionBuilder

RootObjectDefinition() public static method

Create a new ObjectDefinitionBuilder used to construct a root object definition.
public static RootObjectDefinition ( IObjectDefinitionFactory objectDefinitionFactory, Type objectType ) : ObjectDefinitionBuilder
objectDefinitionFactory IObjectDefinitionFactory The object definition factory.
objectType System.Type Type of the object.
return ObjectDefinitionBuilder

RootObjectDefinition() public static method

Create a new ObjectDefinitionBuilder used to construct a root object definition.
public static RootObjectDefinition ( IObjectDefinitionFactory objectDefinitionFactory, Type objectType, string factoryMethodName ) : ObjectDefinitionBuilder
objectDefinitionFactory IObjectDefinitionFactory The object definition factory.
objectType System.Type Type of the object.
factoryMethodName string Name of the factory method.
return ObjectDefinitionBuilder

RootObjectDefinition() public static method

Create a new ObjectDefinitionBuilder used to construct a root object definition.
public static RootObjectDefinition ( IObjectDefinitionFactory objectDefinitionFactory, string objectTypeName ) : ObjectDefinitionBuilder
objectDefinitionFactory IObjectDefinitionFactory The object definition factory.
objectTypeName string The type name of the object.
return ObjectDefinitionBuilder

RootObjectDefinition() public static method

Create a new ObjectDefinitionBuilder used to construct a root object definition.
public static RootObjectDefinition ( IObjectDefinitionFactory objectDefinitionFactory, string objectTypeName, string factoryMethodName ) : ObjectDefinitionBuilder
objectDefinitionFactory IObjectDefinitionFactory The object definition factory.
objectTypeName string Name of the object type.
factoryMethodName string Name of the factory method.
return ObjectDefinitionBuilder

SetAbstract() public method

Sets whether objects or not this definition is abstract.
public SetAbstract ( bool flag ) : ObjectDefinitionBuilder
flag bool if set to true [flag].
return ObjectDefinitionBuilder

SetAutowireCandidate() public method

Sets the autowire candidate value for this definition.
public SetAutowireCandidate ( bool autowireCandidate ) : ObjectDefinitionBuilder
autowireCandidate bool The autowire candidate value
return ObjectDefinitionBuilder

SetAutowireMode() public method

Sets the autowire mode for this definition.
public SetAutowireMode ( AutoWiringMode autowireMode ) : ObjectDefinitionBuilder
autowireMode AutoWiringMode The autowire mode.
return ObjectDefinitionBuilder

SetDependencyCheck() public method

Sets the dependency check mode for this definition.
public SetDependencyCheck ( DependencyCheckingMode dependencyCheck ) : ObjectDefinitionBuilder
dependencyCheck DependencyCheckingMode The dependency check.
return ObjectDefinitionBuilder

SetDestroyMethodName() public method

Sets the name of the destroy method for this definition.
public SetDestroyMethodName ( string methodName ) : ObjectDefinitionBuilder
methodName string Name of the method.
return ObjectDefinitionBuilder

SetFactoryMethod() public method

Sets the name of the factory method to use for this definition.
public SetFactoryMethod ( string factoryMethod ) : ObjectDefinitionBuilder
factoryMethod string The factory method.
return ObjectDefinitionBuilder

SetFactoryObject() public method

Sets the name of the factory object to use for this definition.
public SetFactoryObject ( string factoryObject, string factoryMethod ) : ObjectDefinitionBuilder
factoryObject string The factory object.
factoryMethod string The factory method.
return ObjectDefinitionBuilder

SetInitMethodName() public method

Sets the name of the init method for this definition.
public SetInitMethodName ( string methodName ) : ObjectDefinitionBuilder
methodName string Name of the method.
return ObjectDefinitionBuilder

SetLazyInit() public method

Sets whether objects for this definition should be lazily initialized or not.
public SetLazyInit ( bool lazy ) : ObjectDefinitionBuilder
lazy bool if set to true [lazy].
return ObjectDefinitionBuilder

SetPrimary() public method

Sets the primary value for this definition.
public SetPrimary ( bool primary ) : ObjectDefinitionBuilder
primary bool If object is primary
return ObjectDefinitionBuilder

SetResourceDescription() public method

Sets the resource description for this definition.
public SetResourceDescription ( string resourceDescription ) : ObjectDefinitionBuilder
resourceDescription string The resource description.
return ObjectDefinitionBuilder

SetSingleton() public method

Sets whether or not this definition describes a singleton object.
public SetSingleton ( bool singleton ) : ObjectDefinitionBuilder
singleton bool if set to true [singleton].
return ObjectDefinitionBuilder