code: public String getSubJson(String paramName, String errorMessage, Map<String, Object> mapToUse) throws IOException {
          Object o = mapToUse.get(paramName);
          if (o != null) {
              try {
                  return parent.toJson(o);
              } catch (JsonException e) {
                  throw new IOException(errorMessage, e);
              }
          } else {
              if (errorMessage != null) {
                  throw new IOException(errorMessage);
              } else {
                  return null;
              }
          }
      }
docs: Convenience method for subclasses.
  
  @param paramName    the name of the parameter
  @param errorMessage the errormessage to add to the exception if the param does not exist.
  @param mapToUse     the map to use as input parametersource
  @return a stringparameter with given name. If it does not exist and the errormessage is provided,
  an IOException is thrown with that message. if the errormessage is not provided, null is returned.
  @throws IOException Exception if the paramname does not exist and an errormessage is provided.