A MirrorSystem is the main interface used to reflect on a set of associated libraries.

At runtime each running isolate has a distinct MirrorSystem.

It is also possible to have a MirrorSystem which represents a set of libraries which are not running -- perhaps at compile-time. In this case, all available reflective functionality would be supported, but runtime functionality (such as invoking a function or inspecting the contents of a variable) would fail dynamically.

Static Methods

getName(Symbol symbol) → String

Returns the name of symbol.

getSymbol(String name, [LibraryMirror library]) → Symbol

Returns a symbol for name. If library is not a LibraryMirror or if name is a private identifier and library is null, throws an ArgumentError. If name is a private identifier, the symbol returned is with respect to library.

Properties

dynamicType TypeMirror
read-only

A mirror on the dynamic type.

isolate IsolateMirror
read-only

A mirror on the isolate associated with this MirrorSystem. This may be null if this mirror system is not running.

libraries Map<Uri,LibraryMirror>
read-only

Returns an immutable map from URIs to mirrors for all libraries known to this mirror system. For a runtime mirror system, only libraries which are currently loaded are included, and repeated calls of this method may return different maps as libraries are loaded.

voidType TypeMirror
read-only

A mirror on the void type.

Constructors

MirrorSystem()

Methods

findLibrary(Symbol libraryName) → LibraryMirror

Returns the unique library named libraryName if it exists.