class SqlViewUtils {

    public static String substituteSqlVariables( String sql, Map<String, String> variables )
    {
        String sqlQuery = sql;

        if ( variables != null )
        {
            for ( String param : variables.keySet() )
            {
                if ( param != null && SqlView.isValidQueryParam( param ) )
                {
                    sqlQuery = substituteSqlVariable( sqlQuery, param, variables.get( param ) );
                }
            }
        }

        return sqlQuery;
    }

}