ClassUtil class

Utility class used with Mirror.

Constructors

ClassUtil()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

apply(Function function, List params, [Map<String, dynamic>? namedArgs]) → dynamic
apply a closure function.
applyByMirror(ClosureMirror function, List params, [Map<String, dynamic>? namedArgs]) → dynamic
apply a closure mirror.
coerce(dynamic instance, ClassMirror targetClass, {dynamic coerce(dynamic o, ClassMirror tClass)?}) → dynamic
Coerces the given object to the specified class (targetClass). *
forName(String qname) ClassMirror
Return the ClassMirror of the qualified class name
getElementClassMirror(ClassMirror collection) ClassMirror
Returns the generic element class of the collection class.
getGetterType(ClassMirror classMirror, String field) ClassMirror?
Returns the class mirror of the given field (including getter), or null
getKeyClassMirror(ClassMirror map) ClassMirror
Returns the generic key class of the map class.
getParameterTypes(List<ParameterMirror> params) List<TypeMirror>
Returns the types of the specified parameters
getSetterType(ClassMirror classMirror, String field) ClassMirror?
Returns the class mirror of the given field (including setter), or null
invoke(dynamic instance, MethodMirror method, List params, [Map<String, dynamic>? namedArgs]) → dynamic
Invoke a method of the specified instance.
invokeByMirror(ObjectMirror instance, MethodMirror method, List params, [Map<String, dynamic>? namedArgs]) → dynamic
Invoke a method of the specified ObjectMirror.
isAssignableFrom(ClassMirror tgt, ClassMirror src) bool
Returns whether a source class is assignable to target class.
isInstance(ClassMirror classMirror, dynamic instance) bool
Returns whether the specified object is an instance of the specified class.
isTopClass(ClassMirror classMirror) bool
Returns whether the specified class is the top class (no super class).
newInstance(String className) → dynamic
Create a new instance of the specified class name.
newInstanceByMirror(ClassMirror classMirror) → dynamic
Create a new instance of the specified class mirror.