C# Class Castle.MonoRail.ActiveRecordSupport.ARDataBinder

Extends DataBinder class with some ActiveRecord specific functionality. AutoLoadBehavior ARDataBindAttribute
Autoload can be turned on on the parameter, see AutoLoadBehavior.
Inheritance: Castle.Components.Binder.DataBinder
Show file Open project: nats/castle-1.0.3-mono Class Usage Examples

Protected Properties

Property Type Description
EmptyArg object[]

Public Methods

Method Description
BindObject ( Type targetType, string prefix, string exclude, string allow, string expect, Castle.Components.Binder.CompositeNode treeRoot ) : object

Protected Methods

Method Description
BeforeBindingProperty ( object instance, PropertyInfo prop, string prefix, Castle.Components.Binder.CompositeNode node ) : void
BindSpecialObjectInstance ( Type instanceType, string prefix, Castle.Components.Binder.Node node, bool &succeeded ) : object
CreateInstance ( Type instanceType, String paramPrefix, Castle.Components.Binder.Node node ) : object
FindByPrimaryKey ( Type targetType, object id ) : object
FindByPrimaryKey ( Type targetType, object id, bool throwOnNotFound ) : object
FindPropertyInHasAndBelongsToMany ( ActiveRecordModel model, string propertyName, Type &foundType, ActiveRecordModel &foundModel ) : bool

for joined subclasses HasAndBelongsToMany properties doesn't include the ones of the parent class so we need to check them recursively

FindPropertyInHasMany ( ActiveRecordModel model, string propertyName, Type &foundType, ActiveRecordModel &foundModel ) : bool

for joined subclasses HasMany properties doesn't include the ones of the parent class so we need to check them recursively

IsBelongsToRef ( ActiveRecordModel arModel, string prefix ) : bool

for joined subclasses BelongsTo properties doesn't include the ones of the parent class so we need to check them recursively

IsSpecialType ( Type instanceType ) : bool
PopInstance ( object instance, string prefix ) : void
PushInstance ( object instance, string prefix ) : void
SetPropertyValue ( object instance, PropertyInfo prop, object value ) : void
ShouldRecreateInstance ( object value, Type type, string prefix, Castle.Components.Binder.Node node ) : bool

Private Methods

Method Description
AddToContainer ( object container, object item ) : void
ClearContainer ( object instance ) : void
ClearExpectedCollectionProperties ( object instance, PropertyInfo prop ) : void
CreateContainer ( Type type ) : object
IsContainerType ( Type type ) : bool
IsPropertyExpected ( PropertyInfo prop, Castle.Components.Binder.CompositeNode node ) : bool
IsValidKey ( object id ) : bool
ObtainPrimaryKey ( ActiveRecordModel model ) : PrimaryKeyModel
ObtainPrimaryKeyValue ( ActiveRecordModel model, Castle.Components.Binder.CompositeNode node, String prefix, PrimaryKeyModel &pkModel ) : object

Method Details

BeforeBindingProperty() protected method

protected BeforeBindingProperty ( object instance, PropertyInfo prop, string prefix, Castle.Components.Binder.CompositeNode node ) : void
instance object
prop System.Reflection.PropertyInfo
prefix string
node Castle.Components.Binder.CompositeNode
return void

BindObject() public method

public BindObject ( Type targetType, string prefix, string exclude, string allow, string expect, Castle.Components.Binder.CompositeNode treeRoot ) : object
targetType System.Type
prefix string
exclude string
allow string
expect string
treeRoot Castle.Components.Binder.CompositeNode
return object

BindSpecialObjectInstance() protected method

protected BindSpecialObjectInstance ( Type instanceType, string prefix, Castle.Components.Binder.Node node, bool &succeeded ) : object
instanceType System.Type
prefix string
node Castle.Components.Binder.Node
succeeded bool
return object

CreateInstance() protected method

protected CreateInstance ( Type instanceType, String paramPrefix, Castle.Components.Binder.Node node ) : object
instanceType System.Type
paramPrefix String
node Castle.Components.Binder.Node
return object

FindByPrimaryKey() protected method

protected FindByPrimaryKey ( Type targetType, object id ) : object
targetType System.Type
id object
return object

FindByPrimaryKey() protected method

protected FindByPrimaryKey ( Type targetType, object id, bool throwOnNotFound ) : object
targetType System.Type
id object
throwOnNotFound bool
return object

FindPropertyInHasAndBelongsToMany() protected method

for joined subclasses HasAndBelongsToMany properties doesn't include the ones of the parent class so we need to check them recursively
protected FindPropertyInHasAndBelongsToMany ( ActiveRecordModel model, string propertyName, Type &foundType, ActiveRecordModel &foundModel ) : bool
model Castle.ActiveRecord.Framework.Internal.ActiveRecordModel
propertyName string
foundType System.Type
foundModel Castle.ActiveRecord.Framework.Internal.ActiveRecordModel
return bool

FindPropertyInHasMany() protected method

for joined subclasses HasMany properties doesn't include the ones of the parent class so we need to check them recursively
protected FindPropertyInHasMany ( ActiveRecordModel model, string propertyName, Type &foundType, ActiveRecordModel &foundModel ) : bool
model Castle.ActiveRecord.Framework.Internal.ActiveRecordModel
propertyName string
foundType System.Type
foundModel Castle.ActiveRecord.Framework.Internal.ActiveRecordModel
return bool

IsBelongsToRef() protected method

for joined subclasses BelongsTo properties doesn't include the ones of the parent class so we need to check them recursively
protected IsBelongsToRef ( ActiveRecordModel arModel, string prefix ) : bool
arModel Castle.ActiveRecord.Framework.Internal.ActiveRecordModel
prefix string
return bool

IsSpecialType() protected method

protected IsSpecialType ( Type instanceType ) : bool
instanceType System.Type
return bool

PopInstance() protected method

protected PopInstance ( object instance, string prefix ) : void
instance object
prefix string
return void

PushInstance() protected method

protected PushInstance ( object instance, string prefix ) : void
instance object
prefix string
return void

SetPropertyValue() protected method

protected SetPropertyValue ( object instance, PropertyInfo prop, object value ) : void
instance object
prop System.Reflection.PropertyInfo
value object
return void

ShouldRecreateInstance() protected method

protected ShouldRecreateInstance ( object value, Type type, string prefix, Castle.Components.Binder.Node node ) : bool
value object
type System.Type
prefix string
node Castle.Components.Binder.Node
return bool

Property Details

EmptyArg protected static property

protected static object[] EmptyArg
return object[]