Class QueryUriBuilder
- Since:
- 3.6.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionCreates a builder to append the given property, represented as String URI, with aandoperator in the currentoslc.whereexpression.Creates a builder to append the given property with aandoperator in the currentoslc.whereexpression.Creates a builder to append the given property with aandoperator in the currentoslc.whereexpression.build(UriBuilder builder) Builds a URI, by completing the given URI builder with OSLC query parameters registered on this builder instance.Builds a URI, by completing the given base URI with OSLC query parameters registered on this builder instance.Builds aapplication/x-www-form-urlencodedbody that contains the OSLC query parameters registered on this builder instance.static QueryUriBuildercreate()Creates a new builder instance.static QueryUriBuildercreate(OslcNamespaces namespaces) Creates a new builder instance based on the given namespaces.orderBy(String property, OrderByType type) Adds a property, represented as a String URI, in theoslc.orderByparameter.orderBy(URI property, OrderByType type) Adds a property, represented as a URI, in theoslc.orderByparameter.orderBy(QName property, OrderByType type) Adds a property in theoslc.orderByparameter.pageSize(int pageSize) Defines the desired page size asoslc.pageSizeparameter.paging(boolean paging) Indicates whether paging is to use asoslc.pagingparameter.Registers prefixes to associate to namespaces, to inject in theoslc.prefixparameter.Registers a prefix to associate to a namespace, to inject in theoslc.prefixparameter.properties(String... properties) Adds properties, represented as String URIs, in theoslc.propertiesparameter.properties(URI... properties) Adds properties, represented as URIs, in theoslc.propertiesparameter.properties(QName... properties) Adds properties in theoslc.propertiesparameter.searchTerms(String... terms) Adds search terms in theoslc.searchTermsparameter.Adds properties, represented as String URIs, in theoslc.selectparameter.Adds properties, represented as URIs, in theoslc.selectparameter.Adds properties in theoslc.selectparameter.Creates anoslc.wherebuilder with the given property, represented as String URI.Creates anoslc.wherebuilder with the given property.Creates anoslc.wherebuilder with the given property.
-
Field Details
-
WILDCARD
The wildcard property ("*") that may be used inoslc.select,oslc.propertiesandoslc.whereparameters.
-
-
Method Details
-
create
Creates a new builder instance. The builder will use well-known namespaces for theoslc.prefixparameter if namespace bindings are not added.- Returns:
- a URI builder
- See Also:
-
create
Creates a new builder instance based on the given namespaces. The namespaces are used for theoslc.prefixparameter if namespace bindings are not added.- Parameters:
namespaces- namespaces to used for theoslc.prefixparameter- Returns:
- a URI builder
- Throws:
NullPointerException- if namespaces is null
-
prefix
Registers a prefix to associate to a namespace, to inject in theoslc.prefixparameter.- Parameters:
prefix- the prefix to associate to a namespacenamespace- a namespace- Returns:
- this builder instance
- Throws:
NullPointerException- if prefix or namespace is null
-
prefix
Registers prefixes to associate to namespaces, to inject in theoslc.prefixparameter.- Parameters:
namespaces- prefix/namespace bindings- Returns:
- this builder instance
-
where
Creates anoslc.wherebuilder with the given property.The property must contain a namespace and a local part. It may also contain a prefix which, if present, is automatically registered in the
oslc.prefixparameter. The property may also beWILDCARDto match all properties.Calling this method is for initializing the
oslc.whereparameter. Useand(QName)for adding anotherwhereterm in the expression.- Parameters:
property- the property to use in inoslc.whereparameter- Returns:
- a new term builder instance
- Throws:
NullPointerException- if property is null
-
where
Creates anoslc.wherebuilder with the given property.Calling this method is for initializing the
oslc.whereparameter. Useand(QName)for adding anotherwhereterm in the expression.- Parameters:
property- the property to use in inoslc.whereparameter- Returns:
- a new term builder instance
- Throws:
NullPointerException- if property is nullIllegalArgumentException- if the URI is not absolute
-
where
Creates anoslc.wherebuilder with the given property, represented as String URI. The property may also be a wildcard ("*")Calling this method is for initializing the
oslc.whereparameter. Useand(String)for adding anotherwhereterm in the expression.- Parameters:
property- the property to use in inoslc.whereparameter- Returns:
- a new term builder instance
- Throws:
NullPointerException- if property is nullIllegalArgumentException- if the URI is not absolute
-
and
Creates a builder to append the given property with aandoperator in the currentoslc.whereexpression.The property must contain a namespace and a local part. It may also contain a prefix which, if present, is automatically registered in the
oslc.prefixparameter.- Parameters:
property- the property to use in inoslc.whereparameter- Returns:
- a new term builder instance
- Throws:
NullPointerException- if property is nullIllegalArgumentException- ifwhere(QName)was not called first to record a term
-
and
Creates a builder to append the given property with aandoperator in the currentoslc.whereexpression.- Parameters:
property- the property to use in inoslc.whereparameter- Returns:
- a new term builder instance
- Throws:
NullPointerException- if property is nullIllegalArgumentException- if the URI is not absolute orwhere(URI)was not called first to record a term
-
and
Creates a builder to append the given property, represented as String URI, with aandoperator in the currentoslc.whereexpression. The property may also be a wildcard ("*")- Parameters:
property- the property to use in inoslc.whereparameter- Returns:
- a new term builder instance
- Throws:
NullPointerException- if property is nullIllegalArgumentException- if the URI is not absolute orwhere(String)was not called first to record a term
-
searchTerms
Adds search terms in theoslc.searchTermsparameter.- Parameters:
terms- search terms- Returns:
- this builder instance
-
orderBy
Adds a property in theoslc.orderByparameter.The property must contain a namespace and a local part. It may also contain a prefix which, if present, is automatically registered in the
oslc.prefixparameter.- Parameters:
property- the property to use inoslc.orderBytype- the type of ordering- Returns:
- this builder instance
- Throws:
NullPointerException- if property or type is null
-
orderBy
Adds a property, represented as a URI, in theoslc.orderByparameter.- Parameters:
property- the property to add inoslc.orderBytype- the type of ordering- Returns:
- this builder instance
- Throws:
NullPointerException- if property or type is nullIllegalArgumentException- if the URI is not absolute
-
orderBy
Adds a property, represented as a String URI, in theoslc.orderByparameter.- Parameters:
property- the property to add inoslc.orderBytype- the type of ordering- Returns:
- this builder instance
- Throws:
NullPointerException- if property or type is nullIllegalArgumentException- if the URI is not absolute
-
properties
Adds properties in theoslc.propertiesparameter.The property must contain a namespace and a local part. It may also contain a prefix which, if present, is automatically registered in the
oslc.prefixparameter. The property may also beWILDCARDto select all properties.- Parameters:
properties- properties to add inoslc.properties- Returns:
- this builder instance
- Throws:
IllegalArgumentException- if the QNames do not have a namespace and local part
-
properties
Adds properties, represented as URIs, in theoslc.propertiesparameter.- Parameters:
properties- properties to add inoslc.properties- Returns:
- this builder instance
- Throws:
IllegalArgumentException- if the URIs are not absolute
-
properties
Adds properties, represented as String URIs, in theoslc.propertiesparameter. The property may also be a wildcard ("*")- Parameters:
properties- properties to add inoslc.properties- Returns:
- this builder instance
- Throws:
IllegalArgumentException- if the URIs are not absolute
-
select
Adds properties in theoslc.selectparameter.The property must contain a namespace and a local part. It may also contain a prefix which, if present, is automatically registered in the
oslc.prefixparameter. The property may also beWILDCARDto select all properties.- Parameters:
properties- properties to add inoslc.select- Returns:
- this builder instance
- Throws:
IllegalArgumentException- if the QNames do not have a namespace and local part
-
select
Adds properties, represented as URIs, in theoslc.selectparameter.- Parameters:
properties- properties to add inoslc.select- Returns:
- this builder instance
- Throws:
IllegalArgumentException- if the URIs are not absolute
-
select
Adds properties, represented as String URIs, in theoslc.selectparameter. The property may also be a wildcard ("*")- Parameters:
properties- properties to add inoslc.select- Returns:
- this builder instance
- Throws:
IllegalArgumentException- if the URIs are not absolute
-
paging
Indicates whether paging is to use asoslc.pagingparameter. Settingfalseremoves the current page size, if any.- Parameters:
paging-trueto use paging,falseotherwise- Returns:
- this builder instance
-
pageSize
Defines the desired page size asoslc.pageSizeparameter. Setting a page size also setsoslc.pagingtotrue.- Parameters:
pageSize- the desired page size.- Returns:
- this builder instance
-
build
Builds a URI, by completing the given base URI with OSLC query parameters registered on this builder instance.- Parameters:
baseUri- the URI on which to append query parameters- Returns:
- the URI including OSLC query parameters.
- Throws:
NullPointerException- if baseUri is null- See Also:
-
build
Builds a URI, by completing the given URI builder with OSLC query parameters registered on this builder instance.- Parameters:
builder- the builder on which to append query parameters- Returns:
- the URI including OSLC query parameters.
- Throws:
NullPointerException- if builder is null- See Also:
-
buildPostEntity
Builds aapplication/x-www-form-urlencodedbody that contains the OSLC query parameters registered on this builder instance. This body is to be used as aPOSTrequest entity on a query capability, when parameters are too long for aGETrequest.- Returns:
- a
application/x-www-form-urlencodedbody including OSLC query parameters. - See Also:
-