C# Class NVelocity.Util.Introspection.ClassMap

A cache of introspection information for a specific class instance. Keys {@link java.lang.Method} objects by a concatenation of the method name and the names of classes that make up the parameters.
显示文件 Open project: rasmus-toftdahl-olesen/NVelocity Class Usage Examples

Private Properties

Property Type Description
GetAccessibleMethods System.Reflection.MethodInfo[]
GetAccessibleProperties System.Reflection.PropertyInfo[]
MakeMethodKey String
MakeMethodKey String
PopulateMethodCache void
PopulatePropertyCache void

Public Methods

Method Description
ClassMap ( ) : System
ClassMap ( Type type ) : System

Standard constructor

FindMethod ( String name, Object parameters ) : MethodInfo

Find a Method using the methodKey provided. Look in the methodMap for an entry. If found, it'll either be a CACHE_MISS, in which case we simply give up, or it'll be a Method, in which case, we return it. If nothing is found, then we must actually go and introspect the method from the MethodMap.

FindProperty ( String name ) : PropertyInfo

Find a Method using the methodKey provided. Look in the methodMap for an entry. If found, it'll either be a CACHE_MISS, in which case we simply give up, or it'll be a Method, in which case, we return it. If nothing is found, then we must actually go and introspect the method from the MethodMap.

Private Methods

Method Description
GetAccessibleMethods ( Type type ) : System.Reflection.MethodInfo[]

Retrieves public methods for a class.

GetAccessibleProperties ( Type type ) : System.Reflection.PropertyInfo[]
MakeMethodKey ( MethodInfo method ) : String

Make a methodKey for the given method using the concatenation of the name and the types of the method parameters.

MakeMethodKey ( String method, Object parameters ) : String
PopulateMethodCache ( ) : void

Populate the Map of direct hits. These are taken from all the public methods that our class provides.

PopulatePropertyCache ( ) : void

Method Details

ClassMap() public method

public ClassMap ( ) : System
return System

ClassMap() public method

Standard constructor
public ClassMap ( Type type ) : System
type System.Type
return System

FindMethod() public method

Find a Method using the methodKey provided. Look in the methodMap for an entry. If found, it'll either be a CACHE_MISS, in which case we simply give up, or it'll be a Method, in which case, we return it. If nothing is found, then we must actually go and introspect the method from the MethodMap.
public FindMethod ( String name, Object parameters ) : MethodInfo
name String
parameters Object
return System.Reflection.MethodInfo

FindProperty() public method

Find a Method using the methodKey provided. Look in the methodMap for an entry. If found, it'll either be a CACHE_MISS, in which case we simply give up, or it'll be a Method, in which case, we return it. If nothing is found, then we must actually go and introspect the method from the MethodMap.
public FindProperty ( String name ) : PropertyInfo
name String
return System.Reflection.PropertyInfo