示例#1
0
 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;
 }
示例#2
0
 public static void addSet(ComponentImpl comp, Property prop) {
   Member m =
       comp.getMember(
           ComponentImpl.ACCESS_PRIVATE, KeyImpl.init("set" + prop.getName()), true, false);
   if (!(m instanceof UDF)) {
     UDF udf = new UDFSetterProperty(comp, prop);
     comp.registerUDF(udf.getFunctionName(), udf);
   }
 }
示例#3
0
 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();
 }