Class BasicQueryLanguageProvider
- All Implemented Interfaces:
QueryLanguageProvider<org.apache.sling.jcr.resource.internal.helper.jcr.JcrProviderState>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindResources(@NotNull ResolveContext<org.apache.sling.jcr.resource.internal.helper.jcr.JcrProviderState> ctx, String query, String language) Searches for resources using the given query formulated in the given language.String[]getSupportedLanguages(@NotNull ResolveContext<org.apache.sling.jcr.resource.internal.helper.jcr.JcrProviderState> ctx) The supported languages of the resource provider.queryResources(@NotNull ResolveContext<org.apache.sling.jcr.resource.internal.helper.jcr.JcrProviderState> ctx, String query, String language) Queries the storage using the given query formulated in the given language.
-
Constructor Details
-
BasicQueryLanguageProvider
-
-
Method Details
-
getSupportedLanguages
public String[] getSupportedLanguages(@NotNull @NotNull ResolveContext<org.apache.sling.jcr.resource.internal.helper.jcr.JcrProviderState> ctx) Description copied from interface:QueryLanguageProviderThe supported languages of the resource provider.- Specified by:
getSupportedLanguagesin interfaceQueryLanguageProvider<org.apache.sling.jcr.resource.internal.helper.jcr.JcrProviderState>- Parameters:
ctx- The resolve context- Returns:
- The array of supported languages
-
findResources
public Iterator<Resource> findResources(@NotNull @NotNull ResolveContext<org.apache.sling.jcr.resource.internal.helper.jcr.JcrProviderState> ctx, String query, String language) Description copied from interface:QueryLanguageProviderSearches for resources using the given query formulated in the given language.The semantic meaning of the query and language depend on the actual implementation and storage used for the resources. For JCR repository being used as storage, the query and language parameters are used to create a JCR
Querythrough theQueryManager. The result returned is then based on theNodeIteratorprovided by the query result.- Specified by:
findResourcesin interfaceQueryLanguageProvider<org.apache.sling.jcr.resource.internal.helper.jcr.JcrProviderState>- Parameters:
ctx- The resolve contextquery- The query string to use to find the resources.language- The language in which the query is formulated.- Returns:
- An
IteratorofResourceobjects matching the query. If no resources match,nullmight be returned instead of an empty iterator.
-
queryResources
public Iterator<ValueMap> queryResources(@NotNull @NotNull ResolveContext<org.apache.sling.jcr.resource.internal.helper.jcr.JcrProviderState> ctx, String query, String language) Description copied from interface:QueryLanguageProviderQueries the storage using the given query formulated in the given language.The semantic meaning of the query and language depend on the actual implementation and storage used for the resources. For JCR repository being used as storage, the query and language parameters are used to create a JCR
Querythrough theQueryManager. The result returned is then based on theRowIteratorprovided by the query result. The map returned for each row is indexed by the column name and the column value is the JCRValueobject converted into the respective Java object, such asBooleanfor a value of property type Boolean.- Specified by:
queryResourcesin interfaceQueryLanguageProvider<org.apache.sling.jcr.resource.internal.helper.jcr.JcrProviderState>- Parameters:
ctx- The resolve contextquery- The query string to use to find the resources.language- The language in which the query is formulated.- Returns:
- An
IteratorofMapinstances providing access to the query result. If no resources match,nullmight be returned instead of an empty iterator.
-