[camel] branch master updated: [CAMEL-14046] Allow customization of ValidatorReifiers

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[camel] branch master updated: [CAMEL-14046] Allow customization of ValidatorReifiers

gnodet
This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 6f1e9cf  [CAMEL-14046] Allow customization of ValidatorReifiers
     new 830564e  Merge pull request #3234 from gnodet/CAMEL-14046
6f1e9cf is described below

commit 6f1e9cfe03c68fa0099ef2feb2b3a845127ce5f0
Author: Guillaume Nodet <[hidden email]>
AuthorDate: Wed Oct 9 16:20:26 2019 +0200

    [CAMEL-14046] Allow customization of ValidatorReifiers
---
 .../java/org/apache/camel/reifier/validator/ValidatorReifier.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/ValidatorReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/ValidatorReifier.java
index c32c069..2de79e1 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/ValidatorReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/ValidatorReifier.java
@@ -40,10 +40,14 @@ public abstract class ValidatorReifier<T> {
 
     protected final T definition;
 
-    ValidatorReifier(T definition) {
+    public ValidatorReifier(T definition) {
         this.definition = definition;
     }
 
+    public static void registerReifier(Class<?> processorClass, Function<ValidatorDefinition, ValidatorReifier<? extends ValidatorDefinition>> creator) {
+        VALIDATORS.put(processorClass, creator);
+    }
+
     public static ValidatorReifier<? extends ValidatorDefinition> reifier(ValidatorDefinition definition) {
         Function<ValidatorDefinition, ValidatorReifier<? extends ValidatorDefinition>> reifier = VALIDATORS.get(definition.getClass());
         if (reifier != null) {