PodSmartInstantiationProcessor class abstract

Advanced processor that provides sophisticated control over pod instantiation.

This processor extends PodInstantiationProcessor with additional capabilities for constructor selection, argument resolution, and early pod reference handling. It enables complex instantiation scenarios like circular dependency resolution and advanced AOP integration.

Advanced Features

  • Constructor Resolution: Custom logic for selecting which constructor to use
  • Argument Determination: Sophisticated argument resolution beyond standard DI
  • Early References: Support for circular dependencies through proxy mechanisms
  • AOP Integration: Hook points for aspect-oriented programming frameworks

Example:

@Pod
class SmartProcessor implements PodSmartInstantiationProcessor {
  @override
  Future<List<Constructor>?> determineCandidateConstructors(Class podClass, String name) async {
    // Prefer constructors with @Inject annotation
    final constructors = podClass.getConstructors();
    final injected = constructors.where((c) => c.hasAnnotation<Inject>()).toList();
    return injected.isNotEmpty ? injected : null;
  }
}
Inheritance

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

determineCandidateArguments(String podName, Executable executable, List<Parameter> parameters) Future<List<ArgumentValue>?>
Determines the arguments to use for a specific constructor or factory method.
determineCandidateConstructors(Class podClass, String name) Future<List<Constructor>?>
Determines which constructors should be considered for pod instantiation.
getEarlyPodReference(ObjectHolder<Object> podHolder, Class podClass, String name) Future<ObjectHolder<Object>>
Provides an early reference to a pod before its initialization completes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
populateValues(Object pod, Class podClass, String name) Future<void>
Performs additional value population after standard property population.
inherited
processAfterInstantiation(Object pod, Class podClass, String name) Future<bool>
Processes the pod immediately after instantiation but before property population.
inherited
processBeforeInstantiation(Class podClass, String name) Future<Object?>
Intercepts pod instantiation before the default instantiation process begins.
inherited
processPropertyValues(PropertyValues pvs, Object pod, Class podClass, String name) Future<PropertyValues?>
Transforms property values before they are applied to the pod.
inherited
toString() String
A string representation of this object.
inherited

Operators

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