Package org.h2.bnf.context
Class DbContextRule
- java.lang.Object
-
- org.h2.bnf.context.DbContextRule
-
-
Field Summary
Fields Modifier and Type Field Description static intCOLUMNstatic intCOLUMN_ALIASprivate java.lang.StringcolumnTypeprivate DbContentscontentsstatic intNEW_TABLE_ALIASstatic intPROCEDUREstatic intSCHEMAstatic intTABLEstatic intTABLE_ALIASprivate inttype
-
Constructor Summary
Constructors Constructor Description DbContextRule(DbContents contents, int type)BNF terminal rule Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(BnfVisitor visitor)Call the visit method in the given visitor.booleanautoComplete(Sentence sentence)Add the next possible token(s).private voidautoCompleteProcedure(Sentence sentence)private static java.lang.StringautoCompleteTableAlias(Sentence sentence, boolean newAlias)voidsetColumnType(java.lang.String columnType)voidsetLinks(java.util.HashMap<java.lang.String,RuleHead> ruleMap)Update cross references.private booleantestColumnType(DbColumn column)
-
-
-
Field Detail
-
COLUMN
public static final int COLUMN
- See Also:
- Constant Field Values
-
TABLE
public static final int TABLE
- See Also:
- Constant Field Values
-
TABLE_ALIAS
public static final int TABLE_ALIAS
- See Also:
- Constant Field Values
-
NEW_TABLE_ALIAS
public static final int NEW_TABLE_ALIAS
- See Also:
- Constant Field Values
-
COLUMN_ALIAS
public static final int COLUMN_ALIAS
- See Also:
- Constant Field Values
-
SCHEMA
public static final int SCHEMA
- See Also:
- Constant Field Values
-
PROCEDURE
public static final int PROCEDURE
- See Also:
- Constant Field Values
-
contents
private final DbContents contents
-
type
private final int type
-
columnType
private java.lang.String columnType
-
-
Constructor Detail
-
DbContextRule
public DbContextRule(DbContents contents, int type)
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 Detail
-
setColumnType
public void setColumnType(java.lang.String columnType)
- Parameters:
columnType- COLUMN Auto completion can be filtered by column type
-
setLinks
public void setLinks(java.util.HashMap<java.lang.String,RuleHead> ruleMap)
Description copied from interface:RuleUpdate cross references.
-
accept
public void accept(BnfVisitor visitor)
Description copied from interface:RuleCall the visit method in the given visitor.
-
autoComplete
public boolean autoComplete(Sentence sentence)
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
-
testColumnType
private boolean testColumnType(DbColumn column)
-
autoCompleteProcedure
private void autoCompleteProcedure(Sentence sentence)
-
autoCompleteTableAlias
private static java.lang.String autoCompleteTableAlias(Sentence sentence, boolean newAlias)
-
-