C# Class Castle.Components.Binder.DataBinder

Inheritance: System.MarshalByRefObject, IDataBinder, IServiceEnabledComponent
Datei anzeigen Open project: nats/castle-1.0.3-mono Class Usage Examples

Protected Properties

Property Type Description
PropertiesBindingFlags BindingFlags
errors IList

Public Methods

Method Description
BindObject ( Type targetType, string prefix, Castle.Components.Binder.CompositeNode treeRoot ) : object
BindObject ( Type targetType, string prefix, string excludedProperties, string allowedProperties, Castle.Components.Binder.CompositeNode treeRoot ) : object
BindObjectInstance ( object instance, string prefix, Castle.Components.Binder.CompositeNode treeRoot ) : void
BindObjectInstance ( object instance, string prefix, string excludedProperties, string allowedProperties, Castle.Components.Binder.CompositeNode treeRoot ) : void
BindParameter ( Type desiredType, String paramName, Castle.Components.Binder.CompositeNode treeRoot ) : object
CanBindObject ( Type targetType, String prefix, Castle.Components.Binder.CompositeNode treeRoot ) : bool
CanBindParameter ( Type desiredType, String paramName, Castle.Components.Binder.CompositeNode treeRoot ) : bool
DataBinder ( ) : System

Initializes a new instance of the DataBinder class.

GetValidationSummary ( object instance ) : ErrorSummary

Gets the validation error summary.

Service ( IServiceProvider provider ) : void

Protected Methods

Method Description
AfterBinding ( object instance, String prefix, Castle.Components.Binder.Node node ) : void
BeforeBinding ( object instance, String prefix, Castle.Components.Binder.Node node ) : void
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

Implementations will bound the instance itself. IsSpecialType

IsSpecialType

CheckForValidationFailures ( object instance, Type instanceType, PropertyInfo prop, Castle.Components.Binder.CompositeNode node, string name, string prefix, ErrorSummary summary ) : bool
CheckForValidationFailures ( object instance, Type instanceType, PropertyInfo prop, object value, string name, string prefix, ErrorSummary summary ) : bool
ConvertLeafNode ( Type desiredType, Castle.Components.Binder.LeafNode lNode, bool &conversionSucceeded ) : object
CreateInstance ( Type instanceType, String paramPrefix, Castle.Components.Binder.Node node ) : object
CreateNormalizedList ( String csv ) : String[]
InternalBindObject ( Type instanceType, String paramPrefix, Castle.Components.Binder.Node node ) : object
InternalBindObject ( Type instanceType, String paramPrefix, Castle.Components.Binder.Node node, bool &succeeded ) : object
InternalRecursiveBindObjectInstance ( object instance, String prefix, Castle.Components.Binder.CompositeNode node ) : void
InternalRecursiveBindObjectInstance ( object instance, String prefix, Castle.Components.Binder.Node node ) : void
IsSpecialType ( Type instanceType ) : bool

Invoked during object binding to allow subclasses to have a chance of binding the types itself. If the implementation returns true the binder will invoke BindSpecialObjectInstance

PerformCustomBinding ( object instance, string prefix, Castle.Components.Binder.Node node ) : bool
PopInstance ( object instance, string prefix ) : void
PushInstance ( object instance, string prefix ) : void
SetPropertyValue ( object instance, PropertyInfo prop, object value ) : void

Sets the property value of the object we are binding. Databinders that require different ways to access properties can override this method.

ShouldIgnoreType ( Type instanceType ) : bool
ShouldRecreateInstance ( object value, Type type, String prefix, Castle.Components.Binder.Node node ) : bool

Private Methods

Method Description
ConvertComplexNodesToArray ( Type desiredType, Castle.Components.Binder.IndexedNode parent, bool &conversionSucceeded ) : object
ConvertComplexNodesToList ( Type elemType, Castle.Components.Binder.IndexedNode parent, bool &conversionSucceeded ) : ArrayList
ConvertFlatNodesToArray ( Type desiredType, Castle.Components.Binder.Node nodes, bool &conversionSucceeded ) : object
ConvertFlatNodesToList ( Type elemType, Castle.Components.Binder.Node nodes, bool &conversionSucceeded ) : ArrayList
ConvertToArray ( Type desiredType, String key, Castle.Components.Binder.Node node, bool &conversionSucceeded ) : object
ConvertToGenericList ( Type desiredType, String key, Castle.Components.Binder.Node node, bool &conversionSucceeded ) : object
ConvertToSimpleValue ( Type desiredType, string key, Castle.Components.Binder.CompositeNode parent, bool &conversionSucceeded ) : object
InternalBindGenericList ( Type instanceType, string paramPrefix, Castle.Components.Binder.Node node, bool &succeeded ) : object
InternalBindObjectArray ( Type instanceType, String paramPrefix, Castle.Components.Binder.Node node, bool &succeeded ) : object
IsDateTimeType ( Type desiredType ) : bool
IsGenericList ( Type instanceType ) : bool
IsSimpleProperty ( Type propType ) : bool
NormalizeList ( String list ) : void
RelaxedConvertLeafNode ( Type desiredType, Castle.Components.Binder.Node node, object defaultValue ) : object
ShouldIgnoreProperty ( PropertyInfo prop, string nodeFullName ) : bool
Translate ( Type instanceType, string paramName ) : string
TryGetDateWithUTCFormat ( Castle.Components.Binder.CompositeNode treeRoot, string paramName, bool &conversionSucceeded ) : string
TrySpecialDateTimeBinding ( Type desiredType, Castle.Components.Binder.CompositeNode treeRoot, String paramName, bool &conversionSucceeded ) : object

Method Details

AfterBinding() protected method

protected AfterBinding ( object instance, String prefix, Castle.Components.Binder.Node node ) : void
instance object
prefix String
node Castle.Components.Binder.Node
return void

BeforeBinding() protected method

protected BeforeBinding ( object instance, String prefix, Castle.Components.Binder.Node node ) : void
instance object
prefix String
node Castle.Components.Binder.Node
return void

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, Castle.Components.Binder.CompositeNode treeRoot ) : object
targetType System.Type
prefix string
treeRoot Castle.Components.Binder.CompositeNode
return object

BindObject() public method

public BindObject ( Type targetType, string prefix, string excludedProperties, string allowedProperties, Castle.Components.Binder.CompositeNode treeRoot ) : object
targetType System.Type
prefix string
excludedProperties string
allowedProperties string
treeRoot Castle.Components.Binder.CompositeNode
return object

BindObjectInstance() public method

public BindObjectInstance ( object instance, string prefix, Castle.Components.Binder.CompositeNode treeRoot ) : void
instance object
prefix string
treeRoot Castle.Components.Binder.CompositeNode
return void

BindObjectInstance() public method

public BindObjectInstance ( object instance, string prefix, string excludedProperties, string allowedProperties, Castle.Components.Binder.CompositeNode treeRoot ) : void
instance object
prefix string
excludedProperties string
allowedProperties string
treeRoot Castle.Components.Binder.CompositeNode
return void

BindParameter() public method

public BindParameter ( Type desiredType, String paramName, Castle.Components.Binder.CompositeNode treeRoot ) : object
desiredType System.Type
paramName String
treeRoot Castle.Components.Binder.CompositeNode
return object

BindSpecialObjectInstance() protected method

Implementations will bound the instance itself. IsSpecialType
IsSpecialType
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

CanBindObject() public method

public CanBindObject ( Type targetType, String prefix, Castle.Components.Binder.CompositeNode treeRoot ) : bool
targetType System.Type
prefix String
treeRoot Castle.Components.Binder.CompositeNode
return bool

CanBindParameter() public method

public CanBindParameter ( Type desiredType, String paramName, Castle.Components.Binder.CompositeNode treeRoot ) : bool
desiredType System.Type
paramName String
treeRoot Castle.Components.Binder.CompositeNode
return bool

CheckForValidationFailures() protected method

protected CheckForValidationFailures ( object instance, Type instanceType, PropertyInfo prop, Castle.Components.Binder.CompositeNode node, string name, string prefix, ErrorSummary summary ) : bool
instance object
instanceType System.Type
prop System.Reflection.PropertyInfo
node Castle.Components.Binder.CompositeNode
name string
prefix string
summary Castle.Components.Validator.ErrorSummary
return bool

CheckForValidationFailures() protected method

protected CheckForValidationFailures ( object instance, Type instanceType, PropertyInfo prop, object value, string name, string prefix, ErrorSummary summary ) : bool
instance object
instanceType System.Type
prop System.Reflection.PropertyInfo
value object
name string
prefix string
summary Castle.Components.Validator.ErrorSummary
return bool

ConvertLeafNode() protected method

protected ConvertLeafNode ( Type desiredType, Castle.Components.Binder.LeafNode lNode, bool &conversionSucceeded ) : object
desiredType System.Type
lNode Castle.Components.Binder.LeafNode
conversionSucceeded 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

CreateNormalizedList() protected method

protected CreateNormalizedList ( String csv ) : String[]
csv String
return String[]

DataBinder() public method

Initializes a new instance of the DataBinder class.
public DataBinder ( ) : System
return System

GetValidationSummary() public method

Gets the validation error summary.
public GetValidationSummary ( object instance ) : ErrorSummary
instance object The instance.
return Castle.Components.Validator.ErrorSummary

InternalBindObject() protected method

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

InternalBindObject() protected method

protected InternalBindObject ( Type instanceType, String paramPrefix, Castle.Components.Binder.Node node, bool &succeeded ) : object
instanceType System.Type
paramPrefix String
node Castle.Components.Binder.Node
succeeded bool
return object

InternalRecursiveBindObjectInstance() protected method

protected InternalRecursiveBindObjectInstance ( object instance, String prefix, Castle.Components.Binder.CompositeNode node ) : void
instance object
prefix String
node Castle.Components.Binder.CompositeNode
return void

InternalRecursiveBindObjectInstance() protected method

protected InternalRecursiveBindObjectInstance ( object instance, String prefix, Castle.Components.Binder.Node node ) : void
instance object
prefix String
node Castle.Components.Binder.Node
return void

IsSpecialType() protected method

Invoked during object binding to allow subclasses to have a chance of binding the types itself. If the implementation returns true the binder will invoke BindSpecialObjectInstance
protected IsSpecialType ( Type instanceType ) : bool
instanceType System.Type Type about to be bound
return bool

PerformCustomBinding() protected method

protected PerformCustomBinding ( object instance, string prefix, Castle.Components.Binder.Node node ) : bool
instance object
prefix string
node Castle.Components.Binder.Node
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

Service() public method

public Service ( IServiceProvider provider ) : void
provider IServiceProvider
return void

SetPropertyValue() protected method

Sets the property value of the object we are binding. Databinders that require different ways to access properties can override this method.
protected SetPropertyValue ( object instance, PropertyInfo prop, object value ) : void
instance object
prop System.Reflection.PropertyInfo
value object
return void

ShouldIgnoreType() protected method

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

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

PropertiesBindingFlags protected_oe static_oe property

protected static BindingFlags PropertiesBindingFlags
return BindingFlags

errors protected_oe property

Collect the databind errors
protected IList errors
return IList