code: private String readOptionalString(JSONValue val) {
  
          JSONString str = null == val ? null : val.isString();
          if (str != null) {
              return str.stringValue();
          }
          return null;
      }
docs: Read an optional string value form a JSON value.
  @param val the JSON value that should represent the string.
  @return the string from the JSON or null if reading the string fails.