IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
IKVM.CoreLib.Symbols.Reflection.ReflectionMemberSymbol Class Referenceabstract

Obtains information about the attributes of a member and provides access to member metadata. More...

Inheritance diagram for IKVM.CoreLib.Symbols.Reflection.ReflectionMemberSymbol:
IKVM.CoreLib.Symbols.Reflection.ReflectionSymbol IKVM.CoreLib.Symbols.IMemberSymbol IKVM.CoreLib.Symbols.ISymbol IKVM.CoreLib.Symbols.ISymbol IKVM.CoreLib.Symbols.ICustomAttributeSymbolProvider IKVM.CoreLib.Symbols.Reflection.ReflectionEventSymbol IKVM.CoreLib.Symbols.Reflection.ReflectionFieldSymbol IKVM.CoreLib.Symbols.Reflection.ReflectionMethodBaseSymbol IKVM.CoreLib.Symbols.Reflection.ReflectionPropertySymbol IKVM.CoreLib.Symbols.Reflection.ReflectionTypeSymbol IKVM.CoreLib.Symbols.Reflection.ReflectionConstructorSymbol IKVM.CoreLib.Symbols.Reflection.ReflectionMethodSymbol

Public Member Functions

 ReflectionMemberSymbol (ReflectionSymbolContext context, ReflectionModuleSymbol module, ReflectionTypeSymbol? type, MemberInfo underlyingMember)
 Initializes a new instance.
 
virtual ImmutableArray< CustomAttributeSymbolGetCustomAttributes ()
 Returns an array of all of the custom attributes defined on this member, excluding named attributes, or an empty array if there are no custom attributes.
Returns

 
virtual ImmutableArray< CustomAttributeSymbolGetCustomAttributes (ITypeSymbol attributeType)
 Returns an array of custom attributes defined on this member, identified by type, or an empty array if there are no custom attributes of that type.
Parameters
attributeType
Returns

 
virtual bool IsDefined (ITypeSymbol attributeType)
 Indicates whether one or more instance of attributeType is defined on this member.
Parameters
attributeType
Returns

 
- Public Member Functions inherited from IKVM.CoreLib.Symbols.Reflection.ReflectionSymbol
 ReflectionSymbol (ReflectionSymbolContext context)
 Initializes a new instance.
 
- Public Member Functions inherited from IKVM.CoreLib.Symbols.ICustomAttributeSymbolProvider

Properties

virtual IModuleSymbol Module [get]
 Gets the module in which the type that declares the member represented by the current is defined.
 
virtual ? ITypeSymbol DeclaringType [get]
 Gets the class that declares this member.
 
virtual MemberTypes MemberType [get]
 When overridden in a derived class, gets a value indicating the type of the member - method, constructor, event, and so on.
 
virtual int MetadataToken [get]
 Gets a value that identifies a metadata element.
 
virtual string Name [get]
 Gets the name of the current member.
 
- Properties inherited from IKVM.CoreLib.Symbols.Reflection.ReflectionSymbol
ReflectionSymbolContext Context [get]
 Gets the associated ReflectionSymbolContext.
 
virtual bool IsMissing [get]
 Returns true if the symbol is missing.
 
- Properties inherited from IKVM.CoreLib.Symbols.ISymbol
- Properties inherited from IKVM.CoreLib.Symbols.IMemberSymbol

Additional Inherited Members

- Protected Member Functions inherited from IKVM.CoreLib.Symbols.Reflection.ReflectionSymbol
virtual ReflectionMemberSymbol ResolveMemberSymbol (MemberInfo member)
 Resolves the symbol for the specified type.
 
- Package Functions inherited from IKVM.CoreLib.Symbols.Reflection.ReflectionSymbol

Detailed Description

Obtains information about the attributes of a member and provides access to member metadata.

Definition at line 12 of file ReflectionMemberSymbol.cs.

Constructor & Destructor Documentation

◆ ReflectionMemberSymbol()

IKVM.CoreLib.Symbols.Reflection.ReflectionMemberSymbol.ReflectionMemberSymbol ( ReflectionSymbolContext context,
ReflectionModuleSymbol module,
ReflectionTypeSymbol? type,
MemberInfo underlyingMember )

Initializes a new instance.

Parameters
context
module
type
underlyingMember

Definition at line 26 of file ReflectionMemberSymbol.cs.

26 :
27 base(context)
28 {
29 _module = module ?? throw new ArgumentNullException(nameof(module));
30 _type = type;
31 _underlyingMember = underlyingMember ?? throw new ArgumentNullException(nameof(underlyingMember));
32 }

Member Function Documentation

◆ GetCustomAttributes() [1/2]

virtual ImmutableArray< CustomAttributeSymbol > IKVM.CoreLib.Symbols.Reflection.ReflectionMemberSymbol.GetCustomAttributes ( )
virtual

Returns an array of all of the custom attributes defined on this member, excluding named attributes, or an empty array if there are no custom attributes.

Returns

Implements IKVM.CoreLib.Symbols.ICustomAttributeSymbolProvider.

Definition at line 157 of file ReflectionMemberSymbol.cs.

158 {
159 return ResolveCustomAttributes(_underlyingMember.GetCustomAttributesData());
160 }

◆ GetCustomAttributes() [2/2]

virtual ImmutableArray< CustomAttributeSymbol > IKVM.CoreLib.Symbols.Reflection.ReflectionMemberSymbol.GetCustomAttributes ( ITypeSymbol attributeType)
virtual

Returns an array of custom attributes defined on this member, identified by type, or an empty array if there are no custom attributes of that type.

Parameters
attributeType
Returns

Implements IKVM.CoreLib.Symbols.ICustomAttributeSymbolProvider.

Definition at line 163 of file ReflectionMemberSymbol.cs.

164 {
165 return ResolveCustomAttributes(_underlyingMember.GetCustomAttributesData()).Where(i => i.AttributeType == attributeType).ToImmutableArray();
166 }

◆ IsDefined()

virtual bool IKVM.CoreLib.Symbols.Reflection.ReflectionMemberSymbol.IsDefined ( ITypeSymbol attributeType)
virtual

Indicates whether one or more instance of attributeType is defined on this member.

Parameters
attributeType
Returns

Implements IKVM.CoreLib.Symbols.ICustomAttributeSymbolProvider.

Definition at line 169 of file ReflectionMemberSymbol.cs.

170 {
171 return _underlyingMember.IsDefined(((ReflectionTypeSymbol)attributeType).UnderlyingType);
172 }

Property Documentation

◆ DeclaringType

virtual ? ITypeSymbol IKVM.CoreLib.Symbols.Reflection.ReflectionMemberSymbol.DeclaringType
get

Gets the class that declares this member.

Implements IKVM.CoreLib.Symbols.IMemberSymbol.

Definition at line 145 of file ReflectionMemberSymbol.cs.

◆ MemberType

virtual MemberTypes IKVM.CoreLib.Symbols.Reflection.ReflectionMemberSymbol.MemberType
get

◆ MetadataToken

virtual int IKVM.CoreLib.Symbols.Reflection.ReflectionMemberSymbol.MetadataToken
get

Gets a value that identifies a metadata element.

Implements IKVM.CoreLib.Symbols.IMemberSymbol.

Definition at line 151 of file ReflectionMemberSymbol.cs.

◆ Module

virtual IModuleSymbol IKVM.CoreLib.Symbols.Reflection.ReflectionMemberSymbol.Module
get

Gets the module in which the type that declares the member represented by the current is defined.

Implements IKVM.CoreLib.Symbols.IMemberSymbol.

Definition at line 142 of file ReflectionMemberSymbol.cs.

◆ Name

virtual string IKVM.CoreLib.Symbols.Reflection.ReflectionMemberSymbol.Name
get

Gets the name of the current member.

Implements IKVM.CoreLib.Symbols.IMemberSymbol.

Definition at line 154 of file ReflectionMemberSymbol.cs.


The documentation for this class was generated from the following file: