Package com.anaptecs.jeaf.validation.api
Interface ValidationExecutor
public interface ValidationExecutor
Interface defines a very light-weight approach to validation e.g. in REST environments. This interface is not a
replacement of Java Bean Validation (JSR 303) but rather a simplified facade that e.g. can be used in code that is
generated by JEAF Generator.
- Author:
- JEAF Development Team
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidvalidateObject(Object pObject) Method validates the passed object.default voidvalidateRequest(Class<?> pService, Object... pRequestParameters) Method validates the passed request objects.default voidvalidateResponse(Class<?> pService, Object pResponseObject) Method validates the passed response object.
-
Method Details
-
validateRequest
Method validates the passed request objects. It is expected that implementations throws a runtime exception that describes all the validations that failed.- Parameters:
pService- Class object representing the service to which the passed request object belongs to. The parameter must not be null.pRequestParameters- All request parameters that should be validated. The parameter may be null. Please be aware thatpRequestParametersmight contain a mixture of different types including Java collections classes, primitive arrays etc.
-
validateResponse
Method validates the passed response object. It is expected that implementations throws a runtime exception that describes all the validations that failed.- Parameters:
pService- Class object representing the service to which the passed request object belongs to. The parameter must not be null.pResponseObject- Response object that should be validated. The parameter may be null.
-
validateObject
Method validates the passed object. It is expected that implementations throws a runtime exception that describes all the validations that failed.- Parameters:
pObject- Object that should be validated. The parameter may be null.
-