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 int
static final int
private String
private final DbContents
static final int
static final int
static final int
static final int
static final int
private final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(BnfVisitor visitor) Call the visit method in the given visitor.boolean
autoComplete
(Sentence sentence) Add the next possible token(s).private void
autoCompleteProcedure
(Sentence sentence) private static String
autoCompleteTableAlias
(Sentence sentence, boolean newAlias) void
setColumnType
(String columnType) void
Update cross references.private boolean
testColumnType
(DbColumn column)
-
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:
-
contents
-
type
private final int type -
columnType
-
-
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:Rule
Update cross references. -
accept
Description copied from interface:Rule
Call the visit method in the given visitor. -
autoComplete
Description copied from interface:Rule
Add the next possible token(s). If there was a match, the query in the sentence is updated (the matched token is removed).- Specified by:
autoComplete
in interfaceRule
- Parameters:
sentence
- the sentence context- Returns:
- true if a full match
-
testColumnType
-
autoCompleteProcedure
-
autoCompleteTableAlias
-