# applyBeforeInitializationProcessing method

1. @protected

Future<Object> applyBeforeInitializationProcessing(

1. Object existing,
2. String podName,
3. Class type

)

Applies post-processing to a pod instance after its initialization.

This method is used to apply post-processing to a pod instance after its initialization. It is called by create and getObject methods.

@param podName The name of the pod being created @param type The pod class @return The processed pod instance

## Implementation

    @protected
    Future<Object> applyBeforeInitializationProcessing(Object existing, String podName, Class type) async {
      Object pod = existing;

      if (hasPodPostProcessors()) {
        for (final aware in getPodProcessors()) {
          final shouldProcess = await aware.shouldProcessBeforeInitialization(pod, type, podName);

          if (containsDefinition(podName) && !shouldProcess) {
            final definition = getDefinition(podName);
            if (definition.design.isInfrastructure) {
              return pod;
            }
          }

          Object? processed = await aware.processBeforeInitialization(pod, type, podName);
          if (processed == null) {
            return pod;
          }

          pod = processed;
        }
      }

      return pod;
    }