Skip to content

Commit

Permalink
Support NotEmpty and NotBlank from javax.validation.constraints for I…
Browse files Browse the repository at this point in the history
…ssue #92
  • Loading branch information
daivanov committed Jul 26, 2020
1 parent 0ce963a commit e612e42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import uk.co.jemos.podam.common.*;

import javax.validation.Constraint;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

Expand Down Expand Up @@ -89,6 +91,8 @@ public static AttributeStrategy<?> findAttributeStrategy(DataProviderStrategy st

if (annotation.annotationType().getAnnotation(Constraint.class) != null) {
if (annotation instanceof NotNull ||
annotation instanceof NotBlank ||
annotation instanceof NotEmpty ||
annotation.annotationType().getName().equals("org.hibernate.validator.constraints.NotEmpty") ||
annotation.annotationType().getName().equals("org.hibernate.validator.constraints.NotBlank")) {
/* We don't need to do anything for NotNull constraint */
Expand Down

0 comments on commit e612e42

Please sign in to comment.