You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ri...@apache.org on 2014/03/25 09:18:48 UTC

[1/2] git commit: CAMEL-7300: Don't perform validation (using the default validation profile) during typeconversion.

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....@avisi.nl>
Authored: Mon Mar 17 10:03:54 2014 +0100
Committer: Richard Kettelerij <r....@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);
-    }    
+    }
 
 }


[2/2] git commit: Polishing

Posted by ri...@apache.org.
Polishing


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

Branch: refs/heads/camel-2.13.x
Commit: 067af445576703f563b6dfbcdbe28fcb88bbebba
Parents: b2404a5
Author: Richard Kettelerij <r....@avisi.nl>
Authored: Mon Mar 17 10:22:36 2014 +0100
Committer: Richard Kettelerij <r....@avisi.nl>
Committed: Tue Mar 25 09:16:50 2014 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/component/hl7/HL7Converter.java  | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/067af445/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 3e2a4ae..115cf03 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
@@ -21,6 +21,7 @@ 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;
 
 /**