IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol Class Reference
Inheritance diagram for IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol:
IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionSymbol IKVM.CoreLib.Symbols.IAssemblySymbol IKVM.CoreLib.Symbols.ISymbol IKVM.CoreLib.Symbols.ISymbol IKVM.CoreLib.Symbols.ICustomAttributeSymbolProvider

Public Member Functions

 IkvmReflectionAssemblySymbol (IkvmReflectionSymbolContext context, Assembly underlyingAssembly)
 Initializes a new instance.
 
ITypeSymbol[] GetExportedTypes ()
 Gets the public types defined in this assembly that are visible outside the assembly.
 
IModuleSymbolGetModule (string name)
 Gets the specified module in this assembly.
 
ImmutableArray< IModuleSymbolGetModules ()
 Gets all the modules that are part of this assembly.
 
ImmutableArray< IModuleSymbolGetModules (bool getResourceModules)
 Gets all the modules that are part of this assembly, specifying whether to include resource modules.
 
global::System.Reflection.AssemblyName GetName ()
 Gets an AssemblyName for this assembly.
 
ImmutableArray< global::System.Reflection.AssemblyName > GetReferencedAssemblies ()
 Gets the AssemblyName objects for all the assemblies referenced by this assembly.
 
ITypeSymbolGetType (string name)
 Gets the ITypeSymbol object with the specified name in the assembly instance.
 
ITypeSymbolGetType (string name, bool throwOnError)
 Gets the ITypeSymbol object with the specified name in the assembly instance and optionally throws an exception if the type is not found.
 
ITypeSymbol[] GetTypes ()
 Gets all types defined in this assembly.
 
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.
 
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.
 
bool IsDefined (ITypeSymbol attributeType)
 Indicates whether one or more instance of attributeType is defined on this member.
 
- Public Member Functions inherited from IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionSymbol
 IkvmReflectionSymbol (IkvmReflectionSymbolContext context)
 Initializes a new instance.
 
- Public Member Functions inherited from IKVM.CoreLib.Symbols.IAssemblySymbol
- Public Member Functions inherited from IKVM.CoreLib.Symbols.ICustomAttributeSymbolProvider

Properties

string? FullName [get]
 Gets the display name of the assembly.
 
IModuleSymbol ManifestModule [get]
 Gets the module that contains the manifest for the current assembly.
 
IEnumerable< IModuleSymbolModules [get]
 Gets a collection that contains the modules in this assembly.
 
IEnumerable< ITypeSymbolDefinedTypes [get]
 Gets a collection of the types defined in this assembly.
 
IEnumerable< ITypeSymbolExportedTypes [get]
 Gets a collection of the public types defined in this assembly that are visible outside the assembly.
 
IMethodSymbolEntryPoint [get]
 Gets the entry point of this assembly.
 
override bool IsMissing [get]
 Returns true if the symbol is missing.
 
- Properties inherited from IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionSymbol
IkvmReflectionSymbolContext Context [get]
 Gets the associated IkvmReflectionSymbolContext.
 
virtual bool IsMissing [get]
 Returns true if the symbol is missing.
 
- Properties inherited from IKVM.CoreLib.Symbols.ISymbol
- Properties inherited from IKVM.CoreLib.Symbols.IAssemblySymbol

Additional Inherited Members

- Protected Member Functions inherited from IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionSymbol
virtual IkvmReflectionMemberSymbol ResolveMemberSymbol (MemberInfo member)
 Resolves the symbol for the specified type.
 
- Package Functions inherited from IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionSymbol

Detailed Description

Definition at line 15 of file IkvmReflectionAssemblySymbol.cs.

Constructor & Destructor Documentation

◆ IkvmReflectionAssemblySymbol()

IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.IkvmReflectionAssemblySymbol ( IkvmReflectionSymbolContext context,
Assembly underlyingAssembly )

Initializes a new instance.

Parameters
context
underlyingAssembly

Definition at line 29 of file IkvmReflectionAssemblySymbol.cs.

29 :
30 base(context)
31 {
32 _underlyingAssembly = underlyingAssembly ?? throw new ArgumentNullException(nameof(underlyingAssembly));
33 }

Member Function Documentation

◆ GetCustomAttributes() [1/2]

ImmutableArray< CustomAttributeSymbol > IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.GetCustomAttributes ( )

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 128 of file IkvmReflectionAssemblySymbol.cs.

129 {
130 return _customAttributes.IsDefault ? _customAttributes = ResolveCustomAttributes(_underlyingAssembly.GetCustomAttributesData()) : _customAttributes;
131 }

◆ GetCustomAttributes() [2/2]

ImmutableArray< CustomAttributeSymbol > IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.GetCustomAttributes ( 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

Implements IKVM.CoreLib.Symbols.ICustomAttributeSymbolProvider.

Definition at line 133 of file IkvmReflectionAssemblySymbol.cs.

134 {
135 return ResolveCustomAttributes(_underlyingAssembly.__GetCustomAttributes(((IkvmReflectionTypeSymbol)attributeType).UnderlyingType, false));
136 }

◆ GetExportedTypes()

ITypeSymbol[] IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.GetExportedTypes ( )

Gets the public types defined in this assembly that are visible outside the assembly.

Returns

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 63 of file IkvmReflectionAssemblySymbol.cs.

64 {
65 return ResolveTypeSymbols(_underlyingAssembly.GetExportedTypes());
66 }

◆ GetModule()

IModuleSymbol? IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.GetModule ( string name)

Gets the specified module in this assembly.

Parameters
name
Returns

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 68 of file IkvmReflectionAssemblySymbol.cs.

69 {
70 return _underlyingAssembly.GetModule(name) is Module m ? GetOrCreateModuleSymbol(m) : null;
71 }
IKVM.Reflection.Module Module

◆ GetModules() [1/2]

ImmutableArray< IModuleSymbol > IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.GetModules ( )

Gets all the modules that are part of this assembly.

Returns

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 73 of file IkvmReflectionAssemblySymbol.cs.

74 {
75 return ResolveModuleSymbols(_underlyingAssembly.GetModules()).CastArray<IModuleSymbol>();
76 }

◆ GetModules() [2/2]

ImmutableArray< IModuleSymbol > IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.GetModules ( bool getResourceModules)

Gets all the modules that are part of this assembly, specifying whether to include resource modules.

Parameters
getResourceModules
Returns

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 78 of file IkvmReflectionAssemblySymbol.cs.

79 {
80 return ResolveModuleSymbols(_underlyingAssembly.GetModules(getResourceModules)).CastArray<IModuleSymbol>();
81 }

◆ GetName()

global.System.Reflection.AssemblyName IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.GetName ( )

Gets an AssemblyName for this assembly.

Returns

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 98 of file IkvmReflectionAssemblySymbol.cs.

99 {
100 return _assemblyName ??= ToName(_underlyingAssembly.GetName());
101 }

◆ GetReferencedAssemblies()

ImmutableArray< global.System.Reflection.AssemblyName > IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.GetReferencedAssemblies ( )

Gets the AssemblyName objects for all the assemblies referenced by this assembly.

Returns

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 103 of file IkvmReflectionAssemblySymbol.cs.

104 {
105 var l = _underlyingAssembly.GetReferencedAssemblies().ToImmutableArray();
106 var a = ImmutableArray.CreateBuilder<global::System.Reflection.AssemblyName>(l.Length);
107 for (int i = 0; i < l.Length; i++)
108 a.Add(ToName(l[i]));
109
110 return a.DrainToImmutable();
111 }

◆ GetType() [1/2]

ITypeSymbol? IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.GetType ( string name)

Gets the ITypeSymbol object with the specified name in the assembly instance.

Parameters
name
Returns

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 113 of file IkvmReflectionAssemblySymbol.cs.

114 {
115 return _underlyingAssembly.GetType(name) is Type t ? Context.GetOrCreateTypeSymbol(t) : null;
116 }
IKVM.Reflection.Type Type
IkvmReflectionTypeSymbol GetOrCreateTypeSymbol(Type type)
Gets or creates a IkvmReflectionTypeSymbol for the specified Type.
IkvmReflectionSymbolContext Context
Gets the associated IkvmReflectionSymbolContext.

◆ GetType() [2/2]

ITypeSymbol? IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.GetType ( string name,
bool throwOnError )

Gets the ITypeSymbol object with the specified name in the assembly instance and optionally throws an exception if the type is not found.

Parameters
name
throwOnError
Returns

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 118 of file IkvmReflectionAssemblySymbol.cs.

119 {
120 return _underlyingAssembly.GetType(name, throwOnError) is Type t ? Context.GetOrCreateTypeSymbol(t) : null;
121 }

◆ GetTypes()

ITypeSymbol[] IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.GetTypes ( )

Gets all types defined in this assembly.

Returns

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 123 of file IkvmReflectionAssemblySymbol.cs.

124 {
125 return ResolveTypeSymbols(_underlyingAssembly.GetTypes());
126 }

◆ IsDefined()

bool IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.IsDefined ( ITypeSymbol attributeType)

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

Parameters
attributeType
Returns

Implements IKVM.CoreLib.Symbols.ICustomAttributeSymbolProvider.

Definition at line 138 of file IkvmReflectionAssemblySymbol.cs.

139 {
140 return _underlyingAssembly.IsDefined(((IkvmReflectionTypeSymbol)attributeType).UnderlyingType, false);
141 }

Property Documentation

◆ DefinedTypes

IEnumerable<ITypeSymbol> IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.DefinedTypes
get

Gets a collection of the types defined in this assembly.

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 55 of file IkvmReflectionAssemblySymbol.cs.

◆ EntryPoint

IMethodSymbol? IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.EntryPoint
get

Gets the entry point of this assembly.

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 59 of file IkvmReflectionAssemblySymbol.cs.

59{ } m ? ResolveMethodSymbol(m) : null;

◆ ExportedTypes

IEnumerable<ITypeSymbol> IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.ExportedTypes
get

Gets a collection of the public types defined in this assembly that are visible outside the assembly.

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 57 of file IkvmReflectionAssemblySymbol.cs.

◆ FullName

string? IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.FullName
get

Gets the display name of the assembly.

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 49 of file IkvmReflectionAssemblySymbol.cs.

◆ IsMissing

override bool IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.IsMissing
get

Returns true if the symbol is missing.

Implements IKVM.CoreLib.Symbols.ISymbol.

Definition at line 61 of file IkvmReflectionAssemblySymbol.cs.

◆ ManifestModule

IModuleSymbol IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.ManifestModule
get

Gets the module that contains the manifest for the current assembly.

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 51 of file IkvmReflectionAssemblySymbol.cs.

◆ Modules

IEnumerable<IModuleSymbol> IKVM.CoreLib.Symbols.IkvmReflection.IkvmReflectionAssemblySymbol.Modules
get

Gets a collection that contains the modules in this assembly.

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 53 of file IkvmReflectionAssemblySymbol.cs.


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