core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerJSON.java
private Object getValueAsObjectOrMap(ODocument iRecord, String iFieldValue, OType iType, OType iLinkedType,
      Map<String, Character> iFieldTypes, boolean iNoMap, String iOptions) {
    final String[] fields = OStringParser.getWords(iFieldValue.substring(1, iFieldValue.length() - 1), ":,", true);

    if (fields == null || fields.length == 0)
      if (iNoMap) {
        ODocument res = new ODocument();
        ODocumentInternal.addOwner(res, iRecord);
        return res;
      } else
        return new HashMap<String, Object>();

    if (iNoMap || hasTypeField(fields)) {
      return getValueAsRecord(iRecord, iFieldValue, iType, iOptions, fields);
    } else {
      return getValueAsMap(iRecord, iFieldValue, iLinkedType, iFieldTypes, false, iOptions, fields);
    }
  }
private Object getValueAsObjectOrMap(ODocument iRecord, String iFieldValue, OType iType, OType iLinkedType,
      Map<String, Character> iFieldTypes, boolean iNoMap, String iOptions) {
    final String[] fields = OStringParser.getWords(iFieldValue.substring(1, iFieldValue.length() - 1), ":,", true);

    if (fields == null || fields.length == 0)
      if (iNoMap) {
        ODocument res = new ODocument();
        ODocumentInternal.addOwner(res, iRecord);
        return res;
      } else
        return new HashMap<String, Object>();

    if (iNoMap || hasTypeField(fields)) {
      return getValueAsRecord(iRecord, iFieldValue, iType, iOptions, fields);
    } else {
      return getValueAsMap(iRecord, iFieldValue, iLinkedType, iFieldTypes, false, iOptions, fields);
    }
  }
OBJECT OR MAP. CHECK THE TYPE ATTRIBUTE TO KNOW IT.