public final class QuerySupport extends Object
Modifier and Type | Class and Description |
---|---|
static class |
QuerySupport.Kind
Encodes a type of the name kind used by
QuerySupport.query(java.lang.String, java.lang.String, org.netbeans.modules.parsing.spi.indexing.support.QuerySupport.Kind, java.lang.String...) . |
static class |
QuerySupport.Query
An index query.
|
Modifier and Type | Method and Description |
---|---|
static Collection<FileObject> |
findDependentRoots(FileObject file,
boolean filterNonOpenedProjects)
Returns the dependent source roots for given source root.
|
static Map<Project,Collection<FileObject>> |
findRoots(Collection<? extends Project> projects,
Collection<String> sourcePathIds,
Collection<String> libraryPathIds,
Collection<String> binaryLibraryPathIds)
Gets classpath roots relevant for a projects.
|
static Collection<FileObject> |
findRoots(FileObject f,
Collection<String> sourcePathIds,
Collection<String> libraryPathIds,
Collection<String> binaryLibraryPathIds)
Gets classpath roots relevant for a file.
|
static Collection<FileObject> |
findRoots(Project project,
Collection<String> sourcePathIds,
Collection<String> libraryPathIds,
Collection<String> binaryLibraryPathIds)
Gets classpath roots relevant for a project.
|
static QuerySupport |
forRoots(String indexerName,
int indexerVersion,
FileObject... roots) |
static QuerySupport |
forRoots(String indexerName,
int indexerVersion,
URL... roots) |
QuerySupport.Query.Factory |
getQueryFactory()
Returns the factory for creating composite queries.
|
Collection<? extends IndexResult> |
query(String fieldName,
String fieldValue,
QuerySupport.Kind kind,
String... fieldsToLoad) |
@NonNull public static Collection<FileObject> findRoots(FileObject f, Collection<String> sourcePathIds, Collection<String> libraryPathIds, Collection<String> binaryLibraryPathIds)
sourcePathIds
, libraryPathIds
and
binaryLibraryPathIds
parameters.
The roots collected from binaryLibraryPathIds
will be translated
by the SourceForBinaryQuery
in order to find relevant sources root.
The roots collected from libraryPathIds
are expected to be
libraries in their sources form (ie. no translation).
f
- The file to find roots for.sourcePathIds
- The IDs of source classpath to look at.libraryPathIds
- The IDs of library classpath to look at.binaryLibraryPathIds
- The IDs of binary library classpath to look at.null
.@NonNull public static Collection<FileObject> findDependentRoots(@NonNull FileObject file, boolean filterNonOpenedProjects)
file
- to find the dependent roots forfilterNonOpenedProjects
- if true the results contains only roots of
opened projectsCollection
of FileObject
s containing at least the incoming
root, never returns null.@NonNull public static Collection<FileObject> findRoots(@NullAllowed Project project, @NullAllowed Collection<String> sourcePathIds, @NullAllowed Collection<String> libraryPathIds, @NullAllowed Collection<String> binaryLibraryPathIds)
sourcePathIds
, libraryPathIds
and
binaryPathIds
supplied by the project
.
The roots collected from binaryLibraryPathIds
will be translated
by the SourceForBinaryQuery
in order to find relevant sources root.
The roots collected from libraryPathIds
are expected to be
libraries in their sources form (ie. no translation).
project
- The project to find the roots for. Can be null
in
which case the method searches in all registered classpaths.sourcePathIds
- The IDs of source classpath to look at.libraryPathIds
- The IDs of library classpath to look at.binaryLibraryPathIds
- The IDs of binary library classpath to look at.null
.@NonNull public static Map<Project,Collection<FileObject>> findRoots(@NonNull Collection<? extends Project> projects, @NullAllowed Collection<String> sourcePathIds, @NullAllowed Collection<String> libraryPathIds, @NullAllowed Collection<String> binaryLibraryPathIds)
sourcePathIds
, libraryPathIds
and
binaryPathIds
supplied by the projects
.
The roots collected from binaryLibraryPathIds
will be translated
by the SourceForBinaryQuery
in order to find relevant sources root.
The roots collected from libraryPathIds
are expected to be
libraries in their sources form (ie. no translation).
projects
- The projects to find the roots for.sourcePathIds
- The IDs of source classpath to look at.libraryPathIds
- The IDs of library classpath to look at.binaryLibraryPathIds
- The IDs of binary library classpath to look at.null
.public static QuerySupport forRoots(String indexerName, int indexerVersion, URL... roots) throws IOException
IOException
public static QuerySupport forRoots(String indexerName, int indexerVersion, FileObject... roots) throws IOException
IOException
public Collection<? extends IndexResult> query(String fieldName, String fieldValue, QuerySupport.Kind kind, String... fieldsToLoad) throws IOException
IOException
@NonNull public QuerySupport.Query.Factory getQueryFactory()
QuerySupport.Query.Factory