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

Public Member Functions

 ReflectionAssemblySymbol (ReflectionSymbolContext 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.
 
AssemblyName GetName ()
 Gets an AssemblyName for this assembly.
 
ImmutableArray< AssemblyNameGetReferencedAssemblies ()
 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.Reflection.ReflectionSymbol
 ReflectionSymbol (ReflectionSymbolContext context)
 Initializes a new instance.
 
- Public Member Functions inherited from IKVM.CoreLib.Symbols.IAssemblySymbol
- Public Member Functions inherited from IKVM.CoreLib.Symbols.ICustomAttributeSymbolProvider

Properties

IEnumerable< ITypeSymbolDefinedTypes [get]
 Gets a collection of the types defined in this assembly.
 
IMethodSymbolEntryPoint [get]
 Gets the entry point of this assembly.
 
IEnumerable< ITypeSymbolExportedTypes [get]
 Gets a collection of the public types defined in this assembly that are visible outside the assembly.
 
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.
 
- 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.IAssemblySymbol

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

Definition at line 12 of file ReflectionAssemblySymbol.cs.

Constructor & Destructor Documentation

◆ ReflectionAssemblySymbol()

IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.ReflectionAssemblySymbol ( ReflectionSymbolContext context,
Assembly underlyingAssembly )

Initializes a new instance.

Parameters
context
underlyingAssembly

Definition at line 25 of file ReflectionAssemblySymbol.cs.

25 :
26 base(context)
27 {
28 _underlyingAssembly = underlyingAssembly ?? throw new ArgumentNullException(nameof(underlyingAssembly));
29 }

Member Function Documentation

◆ GetCustomAttributes() [1/2]

ImmutableArray< CustomAttributeSymbol > IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.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 102 of file ReflectionAssemblySymbol.cs.

103 {
104 return _customAttributes.IsDefault ? _customAttributes = ResolveCustomAttributes(_underlyingAssembly.GetCustomAttributesData()) : _customAttributes;
105 }

◆ GetCustomAttributes() [2/2]

ImmutableArray< CustomAttributeSymbol > IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.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 107 of file ReflectionAssemblySymbol.cs.

108 {
109 return GetCustomAttributes().Where(i => i.AttributeType == attributeType).ToImmutableArray();
110 }
ImmutableArray< CustomAttributeSymbol > GetCustomAttributes()
Returns an array of all of the custom attributes defined on this member, excluding named attributes,...

◆ GetExportedTypes()

ITypeSymbol[] IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.GetExportedTypes ( )

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

Returns

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 57 of file ReflectionAssemblySymbol.cs.

58 {
59 return ResolveTypeSymbols(_underlyingAssembly.GetExportedTypes());
60 }

◆ GetModule()

IModuleSymbol? IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.GetModule ( string name)

Gets the specified module in this assembly.

Parameters
name
Returns

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 62 of file ReflectionAssemblySymbol.cs.

63 {
64 return _underlyingAssembly.GetModule(name) is Module m ? GetOrCreateModuleSymbol(m) : null;
65 }
IKVM.Reflection.Module Module

◆ GetModules() [1/2]

ImmutableArray< IModuleSymbol > IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.GetModules ( )

Gets all the modules that are part of this assembly.

Returns

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 67 of file ReflectionAssemblySymbol.cs.

68 {
69 return ResolveModuleSymbols(_underlyingAssembly.GetModules()).CastArray<IModuleSymbol>();
70 }

◆ GetModules() [2/2]

ImmutableArray< IModuleSymbol > IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.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 72 of file ReflectionAssemblySymbol.cs.

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

◆ GetName()

AssemblyName IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.GetName ( )

Gets an AssemblyName for this assembly.

Returns

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 77 of file ReflectionAssemblySymbol.cs.

78 {
79 return _underlyingAssembly.GetName();
80 }

◆ GetReferencedAssemblies()

ImmutableArray< AssemblyName > IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.GetReferencedAssemblies ( )

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

Returns

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 82 of file ReflectionAssemblySymbol.cs.

83 {
84 return _underlyingAssembly.GetReferencedAssemblies().ToImmutableArray();
85 }

◆ GetType() [1/2]

ITypeSymbol? IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.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 87 of file ReflectionAssemblySymbol.cs.

88 {
89 return _underlyingAssembly.GetType(name) is Type t ? Context.GetOrCreateTypeSymbol(t) : null;
90 }
IKVM.Reflection.Type Type
ReflectionTypeSymbol GetOrCreateTypeSymbol(Type type)
Gets or creates a ReflectionTypeSymbol for the specified Type.
ReflectionSymbolContext Context
Gets the associated ReflectionSymbolContext.

◆ GetType() [2/2]

ITypeSymbol? IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.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 92 of file ReflectionAssemblySymbol.cs.

93 {
94 return _underlyingAssembly.GetType(name, throwOnError) is Type t ? Context.GetOrCreateTypeSymbol(t) : null;
95 }

◆ GetTypes()

ITypeSymbol[] IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.GetTypes ( )

Gets all types defined in this assembly.

Returns

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 97 of file ReflectionAssemblySymbol.cs.

98 {
99 return ResolveTypeSymbols(_underlyingAssembly.GetTypes());
100 }

◆ IsDefined()

bool IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.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 112 of file ReflectionAssemblySymbol.cs.

113 {
114 return _underlyingAssembly.IsDefined(((ReflectionTypeSymbol)attributeType).UnderlyingType);
115 }

Property Documentation

◆ DefinedTypes

IEnumerable<ITypeSymbol> IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.DefinedTypes
get

Gets a collection of the types defined in this assembly.

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 45 of file ReflectionAssemblySymbol.cs.

◆ EntryPoint

IMethodSymbol? IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.EntryPoint
get

Gets the entry point of this assembly.

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 47 of file ReflectionAssemblySymbol.cs.

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

◆ ExportedTypes

IEnumerable<ITypeSymbol> IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.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 49 of file ReflectionAssemblySymbol.cs.

◆ FullName

string? IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.FullName
get

Gets the display name of the assembly.

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 51 of file ReflectionAssemblySymbol.cs.

◆ ManifestModule

IModuleSymbol IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.ManifestModule
get

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

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 53 of file ReflectionAssemblySymbol.cs.

◆ Modules

IEnumerable<IModuleSymbol> IKVM.CoreLib.Symbols.Reflection.ReflectionAssemblySymbol.Modules
get

Gets a collection that contains the modules in this assembly.

Implements IKVM.CoreLib.Symbols.IAssemblySymbol.

Definition at line 55 of file ReflectionAssemblySymbol.cs.


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