C# Класс 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
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Описание методов

AddContraintGenericTypeVarArg() публичный Метод

public AddContraintGenericTypeVarArg ( GenericTypeVar g ) : void
g GenericTypeVar
Результат void

AddGenericTypeVarArg() публичный Метод

public AddGenericTypeVarArg ( GenericTypeVar arg ) : void
arg GenericTypeVar
Результат void

CheckBoundParameterizedTypeImpl() публичный статический Метод

public static CheckBoundParameterizedTypeImpl ( GenericTypeVar g, Type bound ) : void
g GenericTypeVar
bound System.Type
Результат void

CheckTypeParameterizedTypeImpl() публичный статический Метод

public static CheckTypeParameterizedTypeImpl ( GenericTypeVar g, Type type ) : void
g GenericTypeVar
type System.Type
Результат void

GenericTypeVar() публичный Метод

public GenericTypeVar ( ) : System
Результат System

GetGenericTypeVarDef() публичный статический Метод

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
Результат GenericTypeVar

GetGenericTypeVarRef() публичный статический Метод

public static GetGenericTypeVarRef ( Type type, List scope ) : GenericTypeVar
type System.Type
scope List
Результат GenericTypeVar

IsDef() публичный Метод

public IsDef ( ) : bool
Результат bool

ResolveGenericTypeVarDefinitionConstraints() публичный статический Метод

public static ResolveGenericTypeVarDefinitionConstraints ( GenericTypeVar g, Type bounds ) : void
g GenericTypeVar
bounds System.Type
Результат void

ResolveGenericTypeVarReferenceConstraints() публичный статический Метод

public static ResolveGenericTypeVarReferenceConstraints ( GenericTypeVar g, Type bounds ) : void
g GenericTypeVar
bounds System.Type
Результат void

ToString() публичный Метод

public ToString ( ) : string
Результат string