code: private PatternType readPatternType(JSONObject val) {
  
          PatternType patterntype;
          try {
              String str = readOptionalString(val, JsonKey.PATTERN_TYPE, "");
              patterntype = PatternType.valueOf(str);
          } catch (IllegalArgumentException e) {
              LOG.debug("Could not read pattern type from JSON. Default to type NONE.", e);
              patterntype = PatternType.NONE;
          }
          return patterntype;
      }
docs: Reads the pattern type from the provided JSON. Defaults to type NONE.
  @param val the JSON object containing the pattern type information.
  @return the pattern type.