String classClusterIds = jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"cluster-ids\"")
.readString(OJSONReader.END_COLLECTION, true).trim();
jsonReader.readNext(OJSONReader.NEXT_IN_OBJECT);
OClassImpl cls = (OClassImpl) database.getMetadata().getSchema().getClass(className);
if (cls != null) {
if (cls.getDefaultClusterId() != classDefClusterId)
cls.setDefaultClusterId(classDefClusterId);
} else
cls = (OClassImpl) database.getMetadata().getSchema().createClass(className, classDefClusterId);
if (classClusterIds != null) {
// REMOVE BRACES
classClusterIds = classClusterIds.substring(1, classClusterIds.length() - 1);
// ASSIGN OTHER CLUSTER IDS
for (int i : OStringSerializerHelper.splitIntArray(classClusterIds)) {
if (i != -1)
cls.addClusterId(i);
}
}
String value;
while (jsonReader.lastChar() == ',') {
jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT);
value = jsonReader.getValue();
if (value.equals("\"strictMode\"")) {
cls.setStrictMode(jsonReader.readBoolean(OJSONReader.NEXT_IN_OBJECT));
} else if (value.equals("\"abstract\"")) {
cls.setAbstract(jsonReader.readBoolean(OJSONReader.NEXT_IN_OBJECT));
} else if (value.equals("\"oversize\"")) {
final String oversize = jsonReader.readString(OJSONReader.NEXT_IN_OBJECT);
cls.setOverSize(Float.parseFloat(oversize));
} else if (value.equals("\"short-name\"")) {
final String shortName = jsonReader.readString(OJSONReader.NEXT_IN_OBJECT);
cls.setShortName(shortName);
} else if (value.equals("\"super-class\"")) {
final String classSuper = jsonReader.readString(OJSONReader.NEXT_IN_OBJECT);
superClasses.put(cls, classSuper);
} else if (value.equals("\"properties\"")) {
// GET PROPERTIES
jsonReader.readNext(OJSONReader.BEGIN_COLLECTION);
while (jsonReader.lastChar() != ']') {
importProperty(cls);
if (jsonReader.lastChar() == '}')
jsonReader.readNext(OJSONReader.NEXT_IN_ARRAY);
}
jsonReader.readNext(OJSONReader.END_OBJECT);
} else if (value.equals("\"cluster-selection\"")) {
// @SINCE 1.7
cls.setClusterSelection(jsonReader.readString(OJSONReader.NEXT_IN_OBJECT));
}
}
classImported++;