code: public static TerminalFactory getTerminalFactory(String spec) throws NoSuchAlgorithmException {
          // Default to bundled JNA by default.
          if (spec == null) {
              spec = JNA_CLASS;
          }
          // Always set the right path to pcsc
          fixPlatformPaths();
  
          // Split by colon marks
          String[] args = spec.split(":");
          if (args.length == 1) {
              // Assumed to be just the class
              return loadTerminalFactory(null, args[0], null, null);
          } else if (args.length == 2) {
              Path jarfile = Paths.get(args[0]);
              // If the first component is a valid file, assume provider!class
              if (Files.exists(jarfile)) {
                  return loadTerminalFactory(args[0], args[1], null, null);
              } else {
                  // Assume the first part is class and the second part is parameter
                  return loadTerminalFactory(null, args[0], null, args[1]);
              }
          } else if (args.length == 3) {
              // jar:class:args
              return loadTerminalFactory(args[0], args[1], null, args[2]);
          } else {
              throw new IllegalArgumentException("Could not parse (too many components): " + spec);
          }
      }
docs: FIXME: use ServiceLoader