use of com.yahoo.search.query.textserialize.item.ItemFormHandler in project vespa by vespa-engine.
the class TextSerialize method parse.
public static Item parse(String serializedQuery) {
try {
ItemContext context = new ItemContext();
Object result = new Parser(new StringReader(serializedQuery.replace("'", "\"")), new ItemFormHandler(), context).start();
context.connectItems();
if (!(result instanceof Item)) {
throw new RuntimeException("The serialized query '" + serializedQuery + "' did not evaluate to an Item" + "(type = " + result.getClass() + ")");
}
return (Item) result;
} catch (ParseException e) {
throw new RuntimeException(e);
} catch (TokenMgrError e) {
throw new RuntimeException(e);
}
}
use of com.yahoo.search.query.textserialize.item.ItemFormHandler in project vespa by vespa-engine.
the class ParseItemTestCase method parse.
public static Object parse(String input) throws ParseException {
ItemContext context = new ItemContext();
Object result = new Parser(new StringReader(input.replace("'", "\"")), new ItemFormHandler(), context).start();
context.connectItems();
return result;
}
Aggregations