code: @Override
      Object convertToObject(CompositeType pType, Object pFrom) {
          // break down the composite type to its field and recurse for converting each field
          JSONAware value = toJSON(pFrom);
          if (!(value instanceof JSONObject)) {
              throw new IllegalArgumentException(
                      "Conversion of " + value + " to " +
                      pType + " failed because provided JSON type " + value.getClass() + " is not a JSONObject");
          }
  
          Map<String, Object> givenValues = (JSONObject) value;
          Map<String, Object> compositeValues = new HashMap<String, Object>();
  
          fillCompositeWithGivenValues(pType, compositeValues, givenValues);
          completeCompositeValuesWithDefaults(pType, compositeValues);
  
          try {
              return new CompositeDataSupport(pType, compositeValues);
          } catch (OpenDataException e) {
              throw new IllegalArgumentException("Internal error: " + e.getMessage(),e);
          }
      }
docs: {@inheritDoc}