Esempio n. 1
0
 public void validate() {
   CheckConditions.checkCondition(
       !RESERVED_FIELD_NAME.contains(getName()),
       new IllegalMetaClassException(String.format("Reserved meta field name %s!", getName())));
   CheckConditions.checkCondition(
       !StringUtils.isNullOrEmpty(getName()),
       new IllegalMetaClassException("meta field name can not be empty"));
   CheckConditions.checkCondition(
       !StringUtils.isNullOrEmpty(getName().trim()),
       new IllegalMetaClassException("meta field name can not be empty"));
   CheckConditions.checkCondition(
       org.apache.commons.lang.StringUtils.containsNone(
           getName(), CMSConsts.INVALID_META_FIELD_NAME_CHARACTERS),
       new IllegalMetaClassException(
           "meta field "
               + name
               + " cannot contains invalid characters: "
               + Arrays.toString(CMSConsts.INVALID_META_FIELD_NAME_CHARACTERS)));
   if (!isInternal()) {
     CheckConditions.checkCondition(
         !INVALID_PATTERN.matcher(getName()).matches(),
         new IllegalMetaClassException(
             "meta field name can not start with regex _[A-Za-z0-9]: " + getName()));
   }
 }
Esempio n. 2
0
 public String getPropertyValueDbName(FieldProperty fp) {
   CheckConditions.checkNotNull(fp, "fp could not be null!");
   return valueDbName + "." + fp.getDbName();
 }
Esempio n. 3
0
 public String getFlattenPropertyValueDbName(FieldProperty fp) {
   CheckConditions.checkNotNull(fp, "fp could not be null!");
   return dbName + VALUE_KEY_CONNECTOR + fp.getDbName();
 }