Biblioteca Java - Blame information for rev 9
Subversion Repositories:
(root)/Spring/SpringWebMVC/InventoryHibernate/src/main/java/com/linkscreens/inventory/validator/ItemValidator.java
Rev | Author | Line No. | Line |
---|---|---|---|
9 | mihai | 1 | package com.linkscreens.inventory.validator; |
2 | |||
3 | import com.linkscreens.inventory.entity.InventoryItem; | ||
4 | import org.springframework.validation.Errors; | ||
5 | import org.springframework.validation.ValidationUtils; | ||
6 | import org.springframework.validation.Validator; | ||
7 | |||
8 | /** | ||
9 | * | ||
10 | */ | ||
11 | public class ItemValidator implements Validator { | ||
12 | |||
13 | @Override | ||
14 | public boolean supports(Class<?> paramClass) { | ||
15 | return InventoryItem.class.equals(paramClass); | ||
16 | } | ||
17 | |||
18 | @Override | ||
19 | public void validate(Object obj, Errors errors) { | ||
20 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "nrCrt", "nrCrt.required"); | ||
21 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "simbolClasaMijlocFix", "simbolClasaMijlocFix.required"); | ||
22 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "mijlocFix", "mijlocFix.required"); | ||
23 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "nrInventar", "nrInventar.required"); | ||
24 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "cont", "cont.required"); | ||
25 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "cantitate", "cantitate.required"); | ||
26 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "UM", "UM.required"); | ||
27 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "pret", "pret.required"); | ||
28 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "valoare", "valoare.required"); | ||
29 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "amortizarePrecedenta", "amortizarePrecedenta.required"); | ||
30 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "amortizareCurenta", "amortizareCurenta.required"); | ||
31 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "amortizareTotala", "amortizareTotala.required"); | ||
32 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "valoareRamasa", "valoareRamasa.required"); | ||
33 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "durataNormala", "durataNormala.required"); | ||
34 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "durataRamasa", "durataRamasa.required"); | ||
35 | } | ||
36 | } |