org.basex.query
Class QuerySuggest

java.lang.Object
  extended by org.basex.util.InputParser
      extended by org.basex.query.QueryParser
          extended by org.basex.query.QuerySuggest

public final class QuerySuggest
extends QueryParser

This class analyzes the current path and gives suggestions for code completions.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Field Summary
 
Fields inherited from class org.basex.query.QueryParser
funcs, modules, namespaces, vars
 
Fields inherited from class org.basex.util.InputParser
file, input, length, mark, pos
 
Constructor Summary
QuerySuggest(java.lang.String q, QueryContext c, Data d)
          Constructor.
 
Method Summary
protected  void checkAxis(Axis axis)
          Performs an optional axis check.
protected  void checkInit()
          Performs an optional check init.
protected  void checkPred(boolean open)
          Checks a predicate.
protected  void checkTest(Test test, boolean attr)
          Performs an optional test check.
 StringList complete()
          Sorts and returns the query suggestions.
 QueryException error(Err err, java.lang.Object... arg)
          Throws the specified error.
 
Methods inherited from class org.basex.query.QueryParser
module, parseLibrary, parseMain
 
Methods inherited from class org.basex.util.InputParser
consume, consume, consume, curr, curr, file, found, info, mark, more, next, quote, rest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuerySuggest

public QuerySuggest(java.lang.String q,
                    QueryContext c,
                    Data d)
             throws QueryException
Constructor.

Parameters:
q - query
c - query context
d - data reference
Throws:
QueryException - query exception
Method Detail

complete

public StringList complete()
Sorts and returns the query suggestions.

Returns:
completions

checkInit

protected void checkInit()
Description copied from class: QueryParser
Performs an optional check init.

Overrides:
checkInit in class QueryParser

checkAxis

protected void checkAxis(Axis axis)
Description copied from class: QueryParser
Performs an optional axis check.

Overrides:
checkAxis in class QueryParser
Parameters:
axis - axis

checkTest

protected void checkTest(Test test,
                         boolean attr)
Description copied from class: QueryParser
Performs an optional test check.

Overrides:
checkTest in class QueryParser
Parameters:
test - node test
attr - attribute flag

checkPred

protected void checkPred(boolean open)
Description copied from class: QueryParser
Checks a predicate.

Overrides:
checkPred in class QueryParser
Parameters:
open - open flag

error

public QueryException error(Err err,
                            java.lang.Object... arg)
                     throws QueryException
Description copied from class: QueryParser
Throws the specified error.

Overrides:
error in class QueryParser
Parameters:
err - error to be thrown
arg - error arguments
Returns:
never
Throws:
QueryException - query exception