src.jptools.parser.language.sql.statements.elements.AbstractSQLHelper Maven / Gradle / Ivy
/*
* AbstractSQLHelper.java
*
* Copyright by jptools, all rights reserved.
*/
package jptools.parser.language.sql.statements.elements;
import jptools.parser.language.sql.SQLSymbolToken;
import jptools.parser.language.sql.statements.SQLSelectStatement;
import jptools.util.KeyValueHolder;
import java.util.ArrayList;
import java.util.List;
/**
* Defines the super class of all helper classes
*
* @author Meier Patrick
* @version $Revision: 1.7 $
*/
public abstract class AbstractSQLHelper
{
private List> expression;
/**
* Constructor for AbstractSQLHelper
*/
public AbstractSQLHelper()
{
super();
expression = new ArrayList>();
}
/**
* Adds an expression
*
* @param token the combination token
* @param exp the expression
*/
public void addExpression( SQLSymbolToken token, String exp )
{
expression.add( new KeyValueHolder( token, exp ) );
}
/**
* Adds a select statement
*
* @param token the combination token
* @param statement the select statement
*/
public void addSelectStatement( SQLSymbolToken token, SQLSelectStatement statement )
{
expression.add( new KeyValueHolder( token, statement ) );
}
/**
* Gets the expression
*
* @return a list with KeyValueHolders. The key contains the combination
* token and the value the expression
*/
public List> getExpressions()
{
return expression;
}
/**
* Create a sub expression list
*
* @param startTags the list contains String or SQLSymbolToken elements
* @return a list with KeyValueHolders. The key contains the combination
* token and the value the expression
*/
public List> getSubExpressionList( List