findAllMixinArguments method
Retrieves all type arguments from all mixins applied to a class.
Parameters:
parentClass
: The class whose mixin arguments should be retrieved.declared
: Whether to include inherited mixins (default:true
).
Returns:
- A list of Class instances representing all mixin type arguments.
Example
final exampleClass = await loader.loadClass<MyClass>('com.example.MyClass');
final args = loader.findAllMixinArguments(exampleClass);
Implementation
@override
List<Class> findAllMixinArguments(Class parentClass, [bool declared = true]) {
_checkClosed();
final cacheKey = "${_buildCacheKey(parentClass)}:mixinArguments:$declared";
// Check cache first
final cached = _mixinArgumentCache[cacheKey];
if (cached != null) {
_hitCount++;
return List.from(cached);
}
_missCount++;
// Compute classes
final classes = _computeAllMixinArguments(parentClass, declared);
// Cache result
_mixinArgumentCache[cacheKey] = classes;
return List.from(classes.toSet().toList());
}