+ /**
+ * Escape the given value to VCF standard.
+ *
+ * @param value
+ * the value to escape
+ *
+ * @return the escaped value
+ */
+ protected String escape(String value) {
+ if (value == null)
+ return null;
+
+ return value.replaceAll(",", "\\\\,").replaceAll(";", "\\\\;")
+ .replaceAll("\n", "\\\\n");
+ }
+
+ /**
+ * Unescape the given value from the VCF standard.
+ *
+ * @param value
+ * the value to unescape
+ *
+ * @return the unescaped value
+ */
+ protected String unescape(String value) {
+ if (value == null)
+ return null;
+
+ return value.replaceAll("\\\\,", ",").replaceAll("\\\\;", ";")
+ .replaceAll("\\\\n", "\n");
+ }
+