class DatawaveSelectorExtractor implements SelectorExtractor {

    @Override
    public List<String> extractSelectors(Query query) throws IllegalArgumentException {
        List<String> selectorList = new ArrayList<>();
        List<ASTEQNode> eqNodes = null;
        QueryNode node = null;
        ASTJexlScript jexlScript = null;
        
        try {
            // Parse & Flatten to reduce the number of node traversals in later method calls
            jexlScript = JexlASTHelper.parseAndFlattenJexlQuery(query.getQuery());
        } catch (Throwable t1) {
            // not JEXL, try LUCENE
            try {
                node = luceneToJexlParser.parse(query.getQuery());
                String jexlQuery = node.getOriginalQuery();
                jexlScript = JexlASTHelper.parseAndFlattenJexlQuery(jexlQuery);
            } catch (Throwable t2) {
                
            }
        }
        
        if (jexlScript != null) {
            eqNodes = JexlASTHelper.getPositiveEQNodes(jexlScript);
        }
        
        for (ASTEQNode n : eqNodes) {
            Object literal = JexlASTHelper.getLiteralValue(n);
            if (literal != null) {
                selectorList.add(literal.toString());
            }
        }
        return selectorList;
    }

}