All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.scalar.db.sql.CommandStatementValidator Maven / Gradle / Ivy

There is a newer version: 3.14.0
Show newest version
package com.scalar.db.sql;

import com.scalar.db.sql.statement.AbortStatement;
import com.scalar.db.sql.statement.BeginStatement;
import com.scalar.db.sql.statement.CommandStatement;
import com.scalar.db.sql.statement.CommandStatementVisitor;
import com.scalar.db.sql.statement.CommitStatement;
import com.scalar.db.sql.statement.DescribeStatement;
import com.scalar.db.sql.statement.JoinStatement;
import com.scalar.db.sql.statement.PrepareStatement;
import com.scalar.db.sql.statement.ResumeStatement;
import com.scalar.db.sql.statement.RollbackStatement;
import com.scalar.db.sql.statement.SetModeStatement;
import com.scalar.db.sql.statement.ShowNamespacesStatement;
import com.scalar.db.sql.statement.ShowTablesStatement;
import com.scalar.db.sql.statement.StartTransactionStatement;
import com.scalar.db.sql.statement.SuspendStatement;
import com.scalar.db.sql.statement.UseStatement;
import com.scalar.db.sql.statement.ValidateStatement;
import com.scalar.db.sql.util.SqlUtils;
import javax.annotation.concurrent.ThreadSafe;

@ThreadSafe
public class CommandStatementValidator implements CommandStatementVisitor {

  CommandStatementValidator() {}

  public void validate(CommandStatement commandStatement) {
    commandStatement.accept(this, null);
  }

  @Override
  public Void visit(BeginStatement statement, Void context) {
    return null;
  }

  @Override
  public Void visit(StartTransactionStatement statement, Void context) {
    return null;
  }

  @Override
  public Void visit(JoinStatement statement, Void context) {
    return null;
  }

  @Override
  public Void visit(SuspendStatement statement, Void context) {
    return null;
  }

  @Override
  public Void visit(ResumeStatement statement, Void context) {
    return null;
  }

  @Override
  public Void visit(PrepareStatement statement, Void context) {
    return null;
  }

  @Override
  public Void visit(ValidateStatement statement, Void context) {
    return null;
  }

  @Override
  public Void visit(CommitStatement statement, Void context) {
    return null;
  }

  @Override
  public Void visit(RollbackStatement statement, Void context) {
    return null;
  }

  @Override
  public Void visit(AbortStatement statement, Void context) {
    return null;
  }

  @Override
  public Void visit(UseStatement statement, Void context) {
    return null;
  }

  @Override
  public Void visit(SetModeStatement statement, Void context) {
    return null;
  }

  @Override
  public Void visit(ShowNamespacesStatement statement, Void context) {
    return null;
  }

  @Override
  public Void visit(ShowTablesStatement statement, Void context) {
    SqlUtils.validateNamespaceName(statement);
    return null;
  }

  @Override
  public Void visit(DescribeStatement statement, Void context) {
    SqlUtils.validateNamespaceName(statement);
    return null;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy