Class PageableFieldValidator
java.lang.Object
org.eclipse.persistence.jpa.rs.features.paging.PageableFieldValidator
Finds out if an entity field is pageable and validates paging parameters.
-
Constructor Summary
ConstructorDescriptionPageableFieldValidator
(Class<?> entityClass, String fieldName, UriInfo uri) Creates the validator. -
Method Summary
Modifier and TypeMethodDescriptionint
getLimit()
Returns a value of Limit paging parameter.int
Returns a value of Offset paging parameter.boolean
Checks if request is valid.
-
Constructor Details
-
PageableFieldValidator
Creates the validator.- Parameters:
entityClass
- entity class containing a field to validate.fieldName
- field name to validate.uri
- request URI.
-
-
Method Details
-
isFeatureApplicable
Checks if request is valid.- Returns:
- true if request is valid and supports pagination, false if request is valid but doesn't support pagination.
- Throws:
JPARSException
- in case of any validation errors.
-
getOffset
public int getOffset()Returns a value of Offset paging parameter. The value is available only after calling checkParameters method.- Returns:
- the Offset value.
-
getLimit
public int getLimit()Returns a value of Limit paging parameter. The value is available only after calling checkParameters method.- Returns:
- the Limit value.
-