C# 클래스 Spring.Objects.ObjectWrapper

상속: IObjectWrapper
파일 보기 프로젝트 열기: spring-projects/spring-net 1 사용 예제들

공개 메소드들

메소드 설명
GetPropertyInfo ( string propertyName ) : PropertyInfo

Returns PropertyInfo for the specified property

GetPropertyInfos ( ) : System.Reflection.PropertyInfo[]

Get the properties of the wrapped object.

GetPropertyType ( string propertyName ) : Type

Get the System.Type for a particular property.

GetPropertyValue ( IExpression propertyExpression ) : object

Gets the value of a property.

GetPropertyValue ( string propertyName ) : object

Gets the value of a property.

ObjectWrapper ( ) : System

Creates a new instance of the Spring.Objects.ObjectWrapper class.

The wrapped target instance will need to be set afterwards.

ObjectWrapper ( Type type ) : System

Creates a new instance of the Spring.Objects.ObjectWrapper class, instantiating a new instance of the specified System.Type and using it as the Spring.Objects.ObjectWrapper.WrappedInstance.

Please note that the System.Type passed as the type argument must have a no-argument constructor. If it does not, an exception will be thrown when this class attempts to instantiate the supplied type using it's (non-existent) constructor.

ObjectWrapper ( object instance ) : System

Creates a new instance of the Spring.Objects.ObjectWrapper class.

SetPropertyValue ( IExpression propertyExpression, object val ) : void

Sets a property value.

SetPropertyValue ( Spring.Objects.PropertyValue pv ) : void

Sets a property value.

This is the preferred way to update an individual property.

SetPropertyValue ( string propertyName, object val ) : void

Sets a property value.

This method is provided for convenience only. The Spring.Objects.ObjectWrapper.SetPropertyValue(PropertyValue) method is more powerful.

SetPropertyValues ( IPropertyValues pvs ) : void

Set a number of property values in bulk.

Does not allow unknown fields. Equivalent to Spring.Objects.ObjectWrapper.SetPropertyValues(IPropertyValues, bool) with and for arguments.

SetPropertyValues ( IPropertyValues propertyValues, bool ignoreUnknown ) : void

Perform a bulk update with full control over behavior.

This method may throw a reflection-based exception, if there is a critical failure such as no matching field... less serious exceptions will be accumulated and thrown as a single Spring.Objects.PropertyAccessExceptionsException.

ToString ( ) : string

This method is expensive! Only call for diagnostics and debugging reasons, not in production.

비공개 메소드들

메소드 설명
GetPropertyExpression ( string propertyName ) : IExpression

Attempts to parse property expression first and falls back to full expression if that fails. Performance optimization.

GetPropertyOrFieldInfo ( string propertyOrFieldName ) : MemberInfo

Returns MemberInfo for the specified property or field

메소드 상세

GetPropertyInfo() 공개 메소드

Returns PropertyInfo for the specified property
If cannot be determined.
public GetPropertyInfo ( string propertyName ) : PropertyInfo
propertyName string The name of the property to search for.
리턴 System.Reflection.PropertyInfo

GetPropertyInfos() 공개 메소드

Get the properties of the wrapped object.
public GetPropertyInfos ( ) : System.Reflection.PropertyInfo[]
리턴 System.Reflection.PropertyInfo[]

GetPropertyType() 공개 메소드

Get the System.Type for a particular property.
public GetPropertyType ( string propertyName ) : Type
propertyName string /// The property the of which is to be retrieved. ///
리턴 System.Type

GetPropertyValue() 공개 메소드

Gets the value of a property.
/// If there is no such property, if the property isn't readable, or /// if getting the property value throws an exception. ///
public GetPropertyValue ( IExpression propertyExpression ) : object
propertyExpression IExpression /// The property expression that should be used to retrieve the property value. ///
리턴 object

GetPropertyValue() 공개 메소드

Gets the value of a property.
/// If there is no such property, if the property isn't readable, or /// if getting the property value throws an exception. ///
public GetPropertyValue ( string propertyName ) : object
propertyName string /// The name of the property to get the value of. ///
리턴 object

ObjectWrapper() 공개 메소드

Creates a new instance of the Spring.Objects.ObjectWrapper class.

The wrapped target instance will need to be set afterwards.

public ObjectWrapper ( ) : System
리턴 System

ObjectWrapper() 공개 메소드

Creates a new instance of the Spring.Objects.ObjectWrapper class, instantiating a new instance of the specified System.Type and using it as the Spring.Objects.ObjectWrapper.WrappedInstance.

Please note that the System.Type passed as the type argument must have a no-argument constructor. If it does not, an exception will be thrown when this class attempts to instantiate the supplied type using it's (non-existent) constructor.

/// If the is , or if the /// invocation of the s default (no-arg) constructor /// fails (due to invalid arguments, insufficient permissions, etc). ///
public ObjectWrapper ( Type type ) : System
type System.Type /// The to instantiate and wrap. ///
리턴 System

ObjectWrapper() 공개 메소드

Creates a new instance of the Spring.Objects.ObjectWrapper class.
/// If the supplied is . ///
public ObjectWrapper ( object instance ) : System
instance object /// The object wrapped by this . ///
리턴 System

SetPropertyValue() 공개 메소드

Sets a property value.
public SetPropertyValue ( IExpression propertyExpression, object val ) : void
propertyExpression IExpression /// The property expression that should be used to set the property value. ///
val object The new value.
리턴 void

SetPropertyValue() 공개 메소드

Sets a property value.

This is the preferred way to update an individual property.

public SetPropertyValue ( Spring.Objects.PropertyValue pv ) : void
pv Spring.Objects.PropertyValue /// The object containing new property value. ///
리턴 void

SetPropertyValue() 공개 메소드

Sets a property value.

This method is provided for convenience only. The Spring.Objects.ObjectWrapper.SetPropertyValue(PropertyValue) method is more powerful.

public SetPropertyValue ( string propertyName, object val ) : void
propertyName string /// The name of the property to set value of. ///
val object The new value.
리턴 void

SetPropertyValues() 공개 메소드

Set a number of property values in bulk.

Does not allow unknown fields. Equivalent to Spring.Objects.ObjectWrapper.SetPropertyValues(IPropertyValues, bool) with and for arguments.

/// If an error is encountered while setting a property. /// /// On a mismatch while setting a property, insufficient permissions, etc. ///
public SetPropertyValues ( IPropertyValues pvs ) : void
pvs IPropertyValues /// The to set on the target /// object. ///
리턴 void

SetPropertyValues() 공개 메소드

Perform a bulk update with full control over behavior.

This method may throw a reflection-based exception, if there is a critical failure such as no matching field... less serious exceptions will be accumulated and thrown as a single Spring.Objects.PropertyAccessExceptionsException.

/// If an error is encountered while setting a property (only thrown if the /// parameter is set to ). /// /// On a mismatch while setting a property, insufficient permissions, etc. ///
public SetPropertyValues ( IPropertyValues propertyValues, bool ignoreUnknown ) : void
propertyValues IPropertyValues /// The s to set on the target object. ///
ignoreUnknown bool /// Should we ignore unknown values (not found in the object!?). ///
리턴 void

ToString() 공개 메소드

This method is expensive! Only call for diagnostics and debugging reasons, not in production.
public ToString ( ) : string
리턴 string