Package io.manebot.database.search
Class Search
- java.lang.Object
-
- io.manebot.database.search.Search
-
public final class Search extends java.lang.Object
Search is the lexical token parsing component of the search argument system. Search is responsible for interpreting textual search queries during argument parsing. The structures represented by the Search class are transformed into database-friendly clauses by a SearchHandler, using its SearchArgumentHandler bindings, which are defined by implementors of the API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Search.Builder
static class
Search.DefaultOrder
static interface
Search.LexicalClause
static interface
Search.Order
-
Method Summary
Modifier and Type Method Description Search.LexicalClause
getLexicalClause()
Gets the root lexical clause encapsulated by this Search instance.java.util.Collection<Search.Order>
getOrders()
Gets the orders that this search has.int
getPage()
static Search
parse(java.lang.String queryString)
Lexically parses a queryString and forms a machine-readable clause structure from the input.
-
-
-
Field Detail
-
EMPTY
public static final Search EMPTY
-
-
Method Detail
-
getOrders
public java.util.Collection<Search.Order> getOrders()
Gets the orders that this search has.- Returns:
- collection of order statements.
-
getLexicalClause
public Search.LexicalClause getLexicalClause()
Gets the root lexical clause encapsulated by this Search instance.- Returns:
- root lexical clause.
-
getPage
public int getPage()
-
parse
public static Search parse(java.lang.String queryString) throws java.lang.IllegalArgumentException
Lexically parses a queryString and forms a machine-readable clause structure from the input. Most of the processing logical processing itself occurs in private class ClauseParser, as the string itself is a clause.- Parameters:
queryString
- query string to parse.- Returns:
- Search object, encapsulating the Clause structure.
- Throws:
java.lang.IllegalArgumentException
- if there was a problem interpreting the given query string.
-
-