camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ricke...@apache.org
Subject [1/2] git commit: CAMEL-7300: Don't perform validation (using the default validation profile) during typeconversion.
Date Tue, 25 Mar 2014 08:18:48 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.13.x 33ed8a9fd -> 067af4455


CAMEL-7300: Don't perform validation (using the default validation profile) during typeconversion.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b2404a5f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b2404a5f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b2404a5f

Branch: refs/heads/camel-2.13.x
Commit: b2404a5f601b6c52951794c49d07fcd25f2bee29
Parents: 33ed8a9
Author: Richard Kettelerij <r.kettelerij@avisi.nl>
Authored: Mon Mar 17 10:03:54 2014 +0100
Committer: Richard Kettelerij <r.kettelerij@avisi.nl>
Committed: Tue Mar 25 09:16:34 2014 +0100

----------------------------------------------------------------------
 .../camel/component/hl7/HL7Converter.java       | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b2404a5f/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7Converter.java
----------------------------------------------------------------------
diff --git a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7Converter.java
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7Converter.java
index 680c424..3e2a4ae 100644
--- a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7Converter.java
+++ b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7Converter.java
@@ -20,7 +20,7 @@ import ca.uhn.hl7v2.HL7Exception;
 import ca.uhn.hl7v2.model.Message;
 import ca.uhn.hl7v2.parser.Parser;
 import ca.uhn.hl7v2.parser.PipeParser;
-
+import ca.uhn.hl7v2.validation.impl.NoValidation;
 import org.apache.camel.Converter;
 
 /**
@@ -33,22 +33,28 @@ public final class HL7Converter {
         // Helper class
     }
 
+    private static Parser getParser() {
+        PipeParser pipeParser = new PipeParser();
+        pipeParser.setValidationContext(new NoValidation());
+        return pipeParser;
+    }
+
     @Converter
     public static String toString(Message message) throws HL7Exception {
-        return encode(message, new PipeParser());
+        return encode(message, getParser());
     }
 
     @Converter
     public static Message toMessage(String body) throws HL7Exception {
-        return parse(body, new PipeParser());
+        return parse(body, getParser());
     }
-    
+
     static Message parse(String body, Parser parser) throws HL7Exception {
         return parser.parse(body);
-    }    
-    
+    }
+
     static String encode(Message message, Parser parser) throws HL7Exception {
         return parser.encode(message);
-    }    
+    }
 
 }


Mime
View raw message