public Node(ISchemaType type, ISchemaProperty prop) {

      this.structureType = prop != null ? prop.getStructureType() : type.getParentStructureType();
      if (structureType == StructureType.COLLECTION) {
        this.array = new JSONArray();
        if (type.isComplex()) {
          array.put(new JSONObject());
          array.put(new JSONObject());
        } else {
          Object defaultValue =
              prop != null
                  ? DefaultValueFactory.getDefaultValue(prop)
                  : DefaultValueFactory.getDefaultValue(type);
          array.put(defaultValue);
          array.put(defaultValue);
        }
      } else if (structureType == StructureType.MAP) {
        this.object = new JSONObject();

        ISchemaType keyType = SimpleType.STRING;
        ISchemaType valueType =
            new TypeModelImpl("Object", "java.lang.Object", null, StructureType.COMMON);
        if (prop != null && prop instanceof IMapSchemaProperty) {
          keyType = ((IMapSchemaProperty) prop).getKeyType();
          valueType = ((IMapSchemaProperty) prop).getValueType();
          if (!keyType.getClassName().equals(SimpleType.STRING.getClassName())) {
            StringBuilder bld =
                new StringBuilder("Invalid map key type. Only String is available as key type.");
            if (type != null) {
              bld.append(" Type: " + type.getClassQualifiedName());
            }
            if (prop != null) {
              bld.append(" Property: " + prop.getName());
            }
            throw new IllegalArgumentException(bld.toString());
          }
        }
        String key = DefaultValueFactory.getDefaultValue(keyType).toString();
        try {
          if (valueType.isComplex()) {
            this.object.put(key + "_1", new JSONObject());
            this.object.put(key + "_2", new JSONObject());
          } else {
            Object defaultValue = DefaultValueFactory.getDefaultValue(valueType);
            this.object.put(key + "_1", defaultValue);
            this.object.put(key + "_2", defaultValue);
          }
        } catch (JSONException e) {
          e.printStackTrace();
        }
      } else if (type.isComplex()) {
        this.object = new JSONObject();
      }
    }