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 Details

  • Constructor Details

  • 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
    • testColumnType

      private boolean testColumnType(DbColumn column)
    • autoCompleteProcedure

      private void autoCompleteProcedure(Sentence sentence)
    • autoCompleteTableAlias

      private static String autoCompleteTableAlias(Sentence sentence, boolean newAlias)