Class ReflectionExtractor
Reflection-based IValueExtractor implementation.
Inherited Members
Namespace: Tangosol.Util.Extractor
Assembly: Coherence.dll
Syntax
public class ReflectionExtractor : AbstractExtractor, IQueryCacheComparer, IComparer, IValueExtractor, IPortableObject
Constructors
ReflectionExtractor()
Default constructor.
Declaration
public ReflectionExtractor()
ReflectionExtractor(string)
Construct a ReflectionExtractor based on a member name.
Declaration
public ReflectionExtractor(string member)
Parameters
Type | Name | Description |
---|---|---|
string | member | The name of the member to invoke via reflection. |
ReflectionExtractor(string, object[])
Construct a ReflectionExtractor.
Declaration
public ReflectionExtractor(string member, object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
string | member | The name of the member to invoke via reflection. |
object[] | parameters | The array of arguments to be used in the method invocation;
may be |
ReflectionExtractor(string, object[], int)
Construct a ReflectionExtractor based on a method name, optional parameters and the entry extraction target.
Declaration
public ReflectionExtractor(string member, object[] parameters, int target)
Parameters
Type | Name | Description |
---|---|---|
string | member | The name of the member to invoke via reflection. |
object[] | parameters | The array of arguments to be used in the method invocation;
may be |
int | target |
Fields
m_memberName
The name of the member to invoke.
Declaration
protected string m_memberName
Field Value
Type | Description |
---|---|
string |
m_parameters
The parameter array.
Declaration
protected object[] m_parameters
Field Value
Type | Description |
---|---|
object[] |
Properties
MemberName
Determine the name of the member that this extractor is configured to invoke.
Declaration
public virtual string MemberName { get; }
Property Value
Type | Description |
---|---|
string | The name of the member to invoke using reflection. |
Parameters
Gets the array of arguments used to invoke the method.
Declaration
public virtual object[] Parameters { get; }
Property Value
Type | Description |
---|---|
object[] | The array of arguments used to invoke the method. |
Methods
Equals(object)
Compare the IValueExtractor with another object to determine equality.
Declaration
public override bool Equals(object o)
Parameters
Type | Name | Description |
---|---|---|
object | o | The object to compare with. |
Returns
Type | Description |
---|---|
bool | true iff this IValueExtractor and the passed object are quivalent IValueExtractors. |
Overrides
Remarks
Two IValueExtractor objects, ve1 and ve2 are considered equal iff ve1.Extract(o) equals ve2.Extract(o) for all values of o.
Extract(object)
Extract the value from the passed object.
Declaration
public override object Extract(object target)
Parameters
Type | Name | Description |
---|---|---|
object | target | An object to retrieve the value from. |
Returns
Type | Description |
---|---|
object | The extracted value as an object; |
Overrides
Remarks
The returned value may be null
.
Exceptions
Type | Condition |
---|---|
InvalidCastException | If this IValueExtractor is incompatible with the passed object to extract a value from and the implementation requires the passed object to be of a certain type. |
ArgumentException | If this IValueExtractor cannot handle the passed object for any other reason; an implementor should include a descriptive message. |
GetHashCode()
Determine a hash value for the IValueExtractor object according to the general object.GetHashCode contract.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | An integer hash value for this IValueExtractor object. |
Overrides
ReadExternal(IPofReader)
Restore the contents of a user type instance by reading its state using the specified IPofReader object.
Declaration
public virtual void ReadExternal(IPofReader reader)
Parameters
Type | Name | Description |
---|---|---|
IPofReader | reader | The IPofReader from which to read the object's state. |
Exceptions
Type | Condition |
---|---|
IOException | If an I/O error occurs. |
ToString()
Provide a human-readable description of this IValueExtractor object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A human-readable description of this IValueExtractor object. |
Overrides
WriteExternal(IPofWriter)
Save the contents of a POF user type instance by writing its state using the specified IPofWriter object.
Declaration
public virtual void WriteExternal(IPofWriter writer)
Parameters
Type | Name | Description |
---|---|---|
IPofWriter | writer | The IPofWriter to which to write the object's state. |
Exceptions
Type | Condition |
---|---|
IOException | If an I/O error occurs. |