Package org.opentides.bean

Examples of org.opentides.bean.UserDefinedField


   *
   * @see org.springframework.validation.Validator#validate(java.lang.Object,
   *      org.springframework.validation.Errors)
   */
  public void validate(Object clazz, Errors e) {
    UserDefinedField udf = (UserDefinedField) clazz;
   
    ValidationUtils.rejectIfEmpty(e, "clazz", "error.required",
        new Object[] { "Class" });
    ValidationUtils.rejectIfEmptyOrWhitespace(e, "userField", "error.required",
        new Object[] { "User Field" });
    ValidationUtils.rejectIfEmptyOrWhitespace(e, "label", "error.required",
        new Object[] { "Label" });
   
    // there must be no duplicate field use per class
    if (udf.getClass()!=null &&
        !StringUtil.isEmpty(udf.getUserField()) ) {
      UserDefinedField example = new UserDefinedField();
      example.setUserField(udf.getUserField());
      example.setClazz(udf.getClazz());
      List<UserDefinedField> duplicate = userDefinedFieldService.findByExample(example, true);
      if (duplicate!=null && !duplicate.isEmpty()
          && !duplicate.get(0).getId().equals(udf.getId())) {
        e.reject("error.duplicate-field",
            new Object[]{udf.getClazz().getSimpleName() + " " + udf.getUserField(), "field"},
View Full Code Here

TOP

Related Classes of org.opentides.bean.UserDefinedField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.