Package org.h2.bnf.context
Class DbContextRule
java.lang.Object
org.h2.bnf.context.DbContextRule
- All Implemented Interfaces:
Rule
A BNF terminal rule that is linked to the database context information.
This class is used by the H2 Console, to support auto-complete.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(BnfVisitor visitor) Call the visit method in the given visitor.booleanautoComplete(Sentence sentence) Add the next possible token(s).voidsetColumnType(String columnType) voidUpdate cross references.
-
Field Details
-
COLUMN
public static final int COLUMN- See Also:
-
TABLE
public static final int TABLE- See Also:
-
TABLE_ALIAS
public static final int TABLE_ALIAS- See Also:
-
NEW_TABLE_ALIAS
public static final int NEW_TABLE_ALIAS- See Also:
-
COLUMN_ALIAS
public static final int COLUMN_ALIAS- See Also:
-
SCHEMA
public static final int SCHEMA- See Also:
-
PROCEDURE
public static final int PROCEDURE- See Also:
-
-
Constructor Details
-
DbContextRule
BNF terminal rule Constructor- Parameters:
contents- Extract rule from this componenttype- Rule type, one ofCOLUMN,TABLE,TABLE_ALIAS,NEW_TABLE_ALIAS,COLUMN_ALIAS,SCHEMA
-
-
Method Details
-
setColumnType
- Parameters:
columnType- COLUMN Auto completion can be filtered by column type
-
setLinks
Description copied from interface:RuleUpdate cross references. -
accept
Description copied from interface:RuleCall the visit method in the given visitor. -
autoComplete
Description copied from interface:RuleAdd the next possible token(s). If there was a match, the query in the sentence is updated (the matched token is removed).- Specified by:
autoCompletein interfaceRule- Parameters:
sentence- the sentence context- Returns:
- true if a full match
-