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
Afficher le fichier Open project: ecologylab/simplCSharp Class Usage Examples

Méthodes publiques

Méthode 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 méthode

public AddContraintGenericTypeVarArg ( GenericTypeVar g ) : void
g GenericTypeVar
Résultat void

AddGenericTypeVarArg() public méthode

public AddGenericTypeVarArg ( GenericTypeVar arg ) : void
arg GenericTypeVar
Résultat void

CheckBoundParameterizedTypeImpl() public static méthode

public static CheckBoundParameterizedTypeImpl ( GenericTypeVar g, Type bound ) : void
g GenericTypeVar
bound System.Type
Résultat void

CheckTypeParameterizedTypeImpl() public static méthode

public static CheckTypeParameterizedTypeImpl ( GenericTypeVar g, Type type ) : void
g GenericTypeVar
type System.Type
Résultat void

GenericTypeVar() public méthode

public GenericTypeVar ( ) : System
Résultat System

GetGenericTypeVarDef() public static méthode

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
Résultat GenericTypeVar

GetGenericTypeVarRef() public static méthode

public static GetGenericTypeVarRef ( Type type, List scope ) : GenericTypeVar
type System.Type
scope List
Résultat GenericTypeVar

IsDef() public méthode

public IsDef ( ) : bool
Résultat bool

ResolveGenericTypeVarDefinitionConstraints() public static méthode

public static ResolveGenericTypeVarDefinitionConstraints ( GenericTypeVar g, Type bounds ) : void
g GenericTypeVar
bounds System.Type
Résultat void

ResolveGenericTypeVarReferenceConstraints() public static méthode

public static ResolveGenericTypeVarReferenceConstraints ( GenericTypeVar g, Type bounds ) : void
g GenericTypeVar
bounds System.Type
Résultat void

ToString() public méthode

public ToString ( ) : string
Résultat string