java.lang.Object
com.erudika.para.core.validation.ValidationUtils
Helper methods for validating objects and generating JSON schemas.
- Author:
- Alex Bogdanovski [[email protected]]
-
Method Summary
Modifier and TypeMethodDescriptionReturns all validation constraints that are defined by Java annotation in the core classes.static jakarta.validation.Validator
A Hibernate Validator.static boolean
isValidObject
(App app, ParaObject obj) Validates objects using Hibernate Validator.static boolean
isValidObject
(ParaObject obj) Validates objects using Hibernate Validator.static String[]
validateObject
(App app, ParaObject content) Validates objects.static String[]
validateObject
(ParaObject content) Validates objects using Hibernate Validator.
-
Method Details
-
getValidator
public static jakarta.validation.Validator getValidator()A Hibernate Validator.- Returns:
- a validator object
-
isValidObject
Validates objects using Hibernate Validator. Used for basic validation.- Parameters:
obj
- an object to be validated- Returns:
- true if the object is valid (all fields are populated properly)
-
isValidObject
Validates objects using Hibernate Validator. Used for full object validation.- Parameters:
app
- the current appobj
- an object to be validated- Returns:
- true if the object is valid (all fields are populated properly)
-
validateObject
Validates objects using Hibernate Validator.- Parameters:
content
- an object to be validated- Returns:
- a list of error messages or empty if object is valid
-
validateObject
Validates objects.- Parameters:
app
- the current appcontent
- an object to be validated- Returns:
- a list of error messages or empty if object is valid
-
getCoreValidationConstraints
-