C# Class Simpl.Serialization.GenericTypeVar

This class encapsulates generic type variables declarations on classes and fields. Different uses of this class:

When used for definition before 'extends' (in ClassDescriptor): name + constraintClassDescriptor (+ constraintGenericTypeVarArgs) | constraintGenericTypeVar:

name: the name of the new generic type var,

constraintClassDescriptor: when the constraint is a concrete class, this holds the class descriptor;

constraintGenericTypeVar: when the constraint is another generic type var, this refers to the definition of that generic type var;

constraintGenericTypeVarArgs: when the constraint is parameterized, this holds type arguments.

When used with field types (in FieldDescriptor):

if the field is purely generic, name + referredGenericTypeVar: name: the generic type var name used as the type, referredGenericTypeVar: refers to the definition of this generic type var in class definition.

if the field is parameterized, the FieldDescriptor should already have the class part of the field type, and its genericTypeVars field should have a list of type arguments. each type argument has classDescriptor / referredGenericTypeVar: classDescriptor: if the argument is a concrete class, referredGenericTypeVar: if the argument is parameterized or another generic type var. it should refer to the definition of that generic type var in class definition.

When used with base type after 'extends' (in ClassDescriptor): similar to the parameterized case when it is used for field type.

@author quyin
Mostrar archivo Open project: ecologylab/simplCSharp Class Usage Examples

Public Methods

Method Description
AddContraintGenericTypeVarArg ( GenericTypeVar g ) : void
AddGenericTypeVarArg ( GenericTypeVar arg ) : void
CheckBoundParameterizedTypeImpl ( GenericTypeVar g, Type bound ) : void
CheckTypeParameterizedTypeImpl ( GenericTypeVar g, Type type ) : void
GenericTypeVar ( ) : System
GetGenericTypeVarDef ( Type typeVariable, List scope ) : GenericTypeVar

Creates a GenericTypeVar object as the definition of a new generic type var, from a java reflection TypeVariable object. the scope of current generic type vars; used to resolve generic type var names.

GetGenericTypeVarRef ( Type type, List scope ) : GenericTypeVar
IsDef ( ) : bool
ResolveGenericTypeVarDefinitionConstraints ( GenericTypeVar g, Type bounds ) : void
ResolveGenericTypeVarReferenceConstraints ( GenericTypeVar g, Type bounds ) : void
ToString ( ) : string

Method Details

AddContraintGenericTypeVarArg() public method

public AddContraintGenericTypeVarArg ( GenericTypeVar g ) : void
g GenericTypeVar
return void

AddGenericTypeVarArg() public method

public AddGenericTypeVarArg ( GenericTypeVar arg ) : void
arg GenericTypeVar
return void

CheckBoundParameterizedTypeImpl() public static method

public static CheckBoundParameterizedTypeImpl ( GenericTypeVar g, Type bound ) : void
g GenericTypeVar
bound System.Type
return void

CheckTypeParameterizedTypeImpl() public static method

public static CheckTypeParameterizedTypeImpl ( GenericTypeVar g, Type type ) : void
g GenericTypeVar
type System.Type
return void

GenericTypeVar() public method

public GenericTypeVar ( ) : System
return System

GetGenericTypeVarDef() public static method

Creates a GenericTypeVar object as the definition of a new generic type var, from a java reflection TypeVariable object. the scope of current generic type vars; used to resolve generic type var names.
public static GetGenericTypeVarDef ( Type typeVariable, List scope ) : GenericTypeVar
typeVariable System.Type
scope List
return GenericTypeVar

GetGenericTypeVarRef() public static method

public static GetGenericTypeVarRef ( Type type, List scope ) : GenericTypeVar
type System.Type
scope List
return GenericTypeVar

IsDef() public method

public IsDef ( ) : bool
return bool

ResolveGenericTypeVarDefinitionConstraints() public static method

public static ResolveGenericTypeVarDefinitionConstraints ( GenericTypeVar g, Type bounds ) : void
g GenericTypeVar
bounds System.Type
return void

ResolveGenericTypeVarReferenceConstraints() public static method

public static ResolveGenericTypeVarReferenceConstraints ( GenericTypeVar g, Type bounds ) : void
g GenericTypeVar
bounds System.Type
return void

ToString() public method

public ToString ( ) : string
return string