diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java index 4042ee2f1..f348488ae 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java @@ -722,6 +722,27 @@ public class Utilities { return s.toString(); } + public static String javaTokenize(String cs, boolean capFirst) { + if (cs == null) + return ""; + StringBuilder s = new StringBuilder(); + boolean upcase = capFirst; + for (int i = 0; i < cs.length(); i++) { + char c = cs.charAt(i); + if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_') { + if (upcase) { + s.append(Character.toUpperCase(c)); + upcase = false; + } else { + s.append(c); + } + } else { + upcase = true; + } + } + return s.toString(); + } + public static boolean isToken(String tail) { if (tail == null || tail.length() == 0) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java index 86b461fbe..3684923b3 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java @@ -135,6 +135,7 @@ public class ValidatorCli { new TxTestsTask(), new TransformTask(), new VersionTask(), + new CodeGenTask(), defaultCliTask); }