Package org.h2.bnf.context

# Class DbContextRule

java.lang.Object
org.h2.bnf.context.DbContextRule

All Implemented Interfaces:
  `Rule`

public class DbContextRule extends Object implements 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

Fields
Modifier and Type
Field
Description
`static final int`
`COLUMN`
`static final int`
`COLUMN_ALIAS`
`static final int`
`NEW_TABLE_ALIAS`
`static final int`
`PROCEDURE`
`static final int`
`SCHEMA`
`static final int`
`TABLE`
`static final int`
`TABLE_ALIAS`

## Constructor Summary

Constructors
Constructor
Description
`DbContextRule(DbContents contents, int type)`
BNF terminal rule Constructor

## Method Summary

Modifier and Type
Method
Description
`void`
`accept(BnfVisitor visitor)`
Call the visit method in the given visitor.
`boolean`
`autoComplete(Sentence sentence)`
Add the next possible token(s).
`void`
`setColumnType(String columnType)`
`void`
`setLinks(HashMap<String,RuleHead> ruleMap)`
Update cross references.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### 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

## Constructor Details

### DbContextRule

public DbContextRule(DbContents contents, int type)
BNF terminal rule Constructor

Parameters:
  `contents` - Extract rule from this component
  `type` - Rule type, one of `COLUMN`, `TABLE`, `TABLE_ALIAS`, `NEW_TABLE_ALIAS`, `COLUMN_ALIAS`, `SCHEMA`

## Method Details

### setColumnType

public void setColumnType(String columnType)

Parameters:
  `columnType` - COLUMN Auto completion can be filtered by column type

### setLinks

public void setLinks(HashMap<String,RuleHead> ruleMap)
Description copied from interface: `Rule`
Update cross references.

Specified by:
  `setLinks` in interface `Rule`
Parameters:
  `ruleMap` - the reference map

### accept

public void accept(BnfVisitor visitor)
Description copied from interface: `Rule`
Call the visit method in the given visitor.

Specified by:
  `accept` in interface `Rule`
Parameters:
  `visitor` - the visitor

### autoComplete

public boolean autoComplete(Sentence sentence)
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 interface `Rule`
Parameters:
  `sentence` - the sentence context
Returns:
  true if a full match