Refactor a findProducers method out of processAllMetaDataProducersInPackage, for more flexibility (e.g., in QBitProducers)

This commit is contained in:
2025-02-21 15:05:11 -06:00
parent 0395e0d02c
commit f4f2f3c80e

View File

@ -106,14 +106,10 @@ public class MetaDataProducerHelper
} }
/***************************************************************************
/*******************************************************************************
** Recursively find all classes in the given package, that implement MetaDataProducerInterface
** run them, and add their output to the given qInstance.
** **
** Note - they'll be sorted by the sortOrder they provide. ***************************************************************************/
*******************************************************************************/ public static List<MetaDataProducerInterface<?>> findProducers(String packageName) throws QException
public static void processAllMetaDataProducersInPackage(QInstance instance, String packageName) throws QException
{ {
List<Class<?>> classesInPackage; List<Class<?>> classesInPackage;
try try
@ -196,6 +192,20 @@ public class MetaDataProducerHelper
} }
})); }));
return (producers);
}
/*******************************************************************************
** Recursively find all classes in the given package, that implement MetaDataProducerInterface
** run them, and add their output to the given qInstance.
**
** Note - they'll be sorted by the sortOrder they provide.
*******************************************************************************/
public static void processAllMetaDataProducersInPackage(QInstance instance, String packageName) throws QException
{
List<MetaDataProducerInterface<?>> producers = findProducers(packageName);
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// execute each one (if enabled), adding their meta data to the instance // // execute each one (if enabled), adding their meta data to the instance //
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////