aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/query/parser/Parser.java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
commit72231250ed81e10d66bfe70701e64fa5fe50f712 (patch)
tree2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /container-search/src/main/java/com/yahoo/search/query/parser/Parser.java
Publish
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/query/parser/Parser.java')
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/parser/Parser.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/parser/Parser.java b/container-search/src/main/java/com/yahoo/search/query/parser/Parser.java
new file mode 100644
index 00000000000..3822b9b67d8
--- /dev/null
+++ b/container-search/src/main/java/com/yahoo/search/query/parser/Parser.java
@@ -0,0 +1,24 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.search.query.parser;
+
+import com.yahoo.search.query.QueryTree;
+
+/**
+ * Defines the interface of a query parser. To construct an instance of this class, use the {@link ParserFactory}.
+ *
+ * @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a>
+ */
+public interface Parser {
+
+ /**
+ * Parser the given {@link Parsable}, and returns a corresponding
+ * {@link QueryTree}. If parsing fails without an exception, the contained
+ * root will be an instance of {@link com.yahoo.prelude.query.NullItem}.
+ *
+ * @param query
+ * the Parsable to parse
+ * @return the parsed QueryTree, never null
+ */
+ QueryTree parse(Parsable query);
+
+}