Class QueryParameters.QueryParametersBuilder
- java.lang.Object
-
- com.sodius.oslc.server.process.query.QueryParameters.QueryParametersBuilder
-
- Enclosing class:
- QueryParameters
public static class QueryParameters.QueryParametersBuilder extends Object
A builder to parse OSLC query parameters.- Since:
- 3.6.0
- See Also:
QueryParameters.from(HttpServletRequest, QueryParameter...)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryParameters
build()
Parses the query parameters part of the scope.QueryParameters.QueryParametersBuilder
reject(QueryParameter... parameters)
Indicates some query parameters that are not supported by the application.QueryParameters.QueryParametersBuilder
require(QueryParameter... parameters)
Indicates some query parameters that are required to be present on the HTTP request.QueryParameters.QueryParametersBuilder
resourceShape(Class<?>... resourceClasses)
Indicates the resource shapes from which OSLC prefixes can be determined.
-
-
-
Method Detail
-
require
public QueryParameters.QueryParametersBuilder require(QueryParameter... parameters)
Indicates some query parameters that are required to be present on the HTTP request. Whenbuilding
, if one of these parameters is absent from the request, an exception with an OSLC Error is thrown.- Parameters:
parameters
- the required parameters- Returns:
- this builder instance
-
reject
public QueryParameters.QueryParametersBuilder reject(QueryParameter... parameters)
Indicates some query parameters that are not supported by the application. Whenbuilding
, if one of these parameters is present in the request, an exception with an OSLC Error is throw.- Parameters:
parameters
- the parameters to reject.- Returns:
- this builder instance
-
resourceShape
public QueryParameters.QueryParametersBuilder resourceShape(Class<?>... resourceClasses)
Indicates the resource shapes from which OSLC prefixes can be determined.The prefixes used in the parameters like
oslc.select
oroslc.where
are resolved to namespaces using theoslc.prefix
parameter, if any, but also with ones defined on theOslcSchema
of the given resource shapes and, last, with well known OSLC prefixes (RDF, OSLC Core, etc.).- Parameters:
resourceClasses
- classes whose owning package define anOslcSchema
annotation- Returns:
- this builder instance
-
build
public QueryParameters build()
Parses the query parameters part of the scope.- Returns:
- the parsed query parameters
- Throws:
WebApplicationException
- if somerequired
parameters are missing, or someunsupported
parameters are present, or some syntax in supported parameters is invalid.
-
-