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

rapture.repo.jdbc.context.ConverterContext Maven / Gradle / Ivy

/**
 * Copyright (C) 2011-2015 Incapture Technologies LLC
 *
 * This is an autogenerated license statement. When copyright notices appear below
 * this one that copyright supercedes this statement.
 *
 * Unless required by applicable law or agreed to in writing, software is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied.
 *
 * Unless explicit permission obtained in writing this software cannot be distributed.
 */
package rapture.repo.jdbc.context;

import java.util.ArrayList;
import java.util.List;

import net.sf.jsqlparser.schema.Table;

/**
 * Created by yanwang on 5/4/15.
 */
public class ConverterContext {

    private List statementContexts = new ArrayList<>();
    private int currLevel = 0;
    private boolean isNegative = false;

    public ConverterContext(StatementType statementType) {
        addStatementContext(statementType);
    }

    public void increaseContextLevel(StatementType statementType) {
        currLevel++;
        addStatementContext(statementType);
    }

    public void decreaseContextLevel() {
        currLevel--;
    }

    public void addTable(Table table) {
        statementContexts.get(currLevel).addTable(table);
    }

    public List getStatementContexts() {
        return statementContexts;
    }

    private void addStatementContext(StatementType statementType) {
        statementContexts.add(new StatementContext(statementType));
    }

    public boolean isNegative() {
        return isNegative;
    }

    public void setNegative(boolean isNegative) {
        this.isNegative = isNegative;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy