public static String getType(Property prop) { String type = prop.getType(); if (StringUtil.isEmpty(type) || "any".equalsIgnoreCase(type) || "object".equalsIgnoreCase(type)) { String fieldType = Caster.toString(prop.getMeta().get(FIELD_TYPE, null), null); if ("one-to-many".equalsIgnoreCase(fieldType) || "many-to-many".equalsIgnoreCase(fieldType)) { return "array"; } return "any"; } return type; }
public static String getSingularName(Property prop) { String singularName = Caster.toString(prop.getMeta().get(SINGULAR_NAME, null), null); if (!StringUtil.isEmpty(singularName)) return singularName; return prop.getName(); }