Package ch.usi.si.seart.treesitter
Class Query.Builder
- java.lang.Object
-
- ch.usi.si.seart.treesitter.Query.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Querybuild()Builds and returns a new Query instance with the configured language and pattern.Query.Builderlanguage(@NotNull Language language)Sets the programming language associated with the query.Query.Builderpattern(@NotNull String pattern)Sets the query pattern that will be used to match nodes.
-
-
-
Method Detail
-
language
public Query.Builder language(@NotNull @NotNull Language language)
Sets the programming language associated with the query.- Parameters:
language- The language associated with the query- Returns:
- this builder
- Throws:
NullPointerException- if the language is nullUnsatisfiedLinkError- if the language was not linked to native codeABIVersionError- if the language ABI version is incompatible with requirements
-
pattern
public Query.Builder pattern(@NotNull @NotNull String pattern)
Sets the query pattern that will be used to match nodes.- Parameters:
pattern- The symbolic expression string of the query pattern.- Returns:
- this builder
- Throws:
NullPointerException- if the pattern is null
-
build
public Query build()
Builds and returns a new Query instance with the configured language and pattern.- Returns:
- A new query instance
- Throws:
QueryException- if query construction fails
-
-