From f4f2f3c80e67f208f7253ed9bc41e54d9cf56877 Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Fri, 21 Feb 2025 15:05:11 -0600 Subject: [PATCH] Refactor a findProducers method out of processAllMetaDataProducersInPackage, for more flexibility (e.g., in QBitProducers) --- .../metadata/MetaDataProducerHelper.java | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/model/metadata/MetaDataProducerHelper.java b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/model/metadata/MetaDataProducerHelper.java index d4600787..487c6dda 100644 --- a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/model/metadata/MetaDataProducerHelper.java +++ b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/model/metadata/MetaDataProducerHelper.java @@ -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 void processAllMetaDataProducersInPackage(QInstance instance, String packageName) throws QException + ***************************************************************************/ + public static List> findProducers(String packageName) throws QException { List> classesInPackage; 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> producers = findProducers(packageName); + /////////////////////////////////////////////////////////////////////////// // execute each one (if enabled), adding their meta data to the instance // ///////////////////////////////////////////////////////////////////////////