コード例 #1
0
 public <T> Set<ConstraintViolation<T>> validateProperty(
     GwtValidationContext<T> context,
     com.cesaco.myprinterp.client.shared.Gruppo object,
     String propertyName,
     Class<?>... groups)
     throws ValidationException {
   try {
     Set<ConstraintViolation<T>> violations = new HashSet<ConstraintViolation<T>>();
     if (propertyName.equals("cod_gruppo")) {
       validateProperty_getcod_gruppo(context, violations, object, object.getCod_gruppo(), groups);
       validateProperty_cod_gruppo(context, violations, object, _cod_gruppo(object), groups);
     } else if (propertyName.equals("des_gruppo")) {
       validateProperty_getdes_gruppo(context, violations, object, object.getDes_gruppo(), groups);
       validateProperty_des_gruppo(context, violations, object, _des_gruppo(object), groups);
     } else if (!ALL_PROPERTY_NAMES.contains(propertyName)) {
       throw new java.lang.IllegalArgumentException(
           propertyName
               + " is not a valid property of com.cesaco.myprinterp.client.shared.Gruppo");
     }
     return violations;
   } catch (IllegalArgumentException e) {
     throw e;
   } catch (ValidationException e) {
     throw e;
   } catch (Exception e) {
     throw new ValidationException(
         "Error validating " + propertyName + " of com.cesaco.myprinterp.client.shared.Gruppo", e);
   }
 }
コード例 #2
0
 public <T> Set<ConstraintViolation<T>> validate(
     GwtValidationContext<T> context,
     com.cesaco.myprinterp.client.shared.Gruppo object,
     Class<?>... groups) {
   try {
     Set<ConstraintViolation<T>> violations = new HashSet<ConstraintViolation<T>>();
     context.addValidatedObject(object);
     validateProperty_getcod_gruppo(context, violations, object, object.getCod_gruppo(), groups);
     validateProperty_cod_gruppo(context, violations, object, _cod_gruppo(object), groups);
     validateProperty_getdes_gruppo(context, violations, object, object.getDes_gruppo(), groups);
     validateProperty_des_gruppo(context, violations, object, _des_gruppo(object), groups);
     return violations;
   } catch (IllegalArgumentException e) {
     throw e;
   } catch (ValidationException e) {
     throw e;
   } catch (Exception e) {
     throw new ValidationException(
         "Error validating com.cesaco.myprinterp.client.shared.Gruppo", e);
   }
 }