class SqlViewUtils {

    public static String substituteSqlVariable( String sql, String name, String value )
    {
        final String regex = "\\$\\{(" + name + ")\\}";

        if ( value != null && SqlView.isValidQueryValue( value ) )
        {
            return sql.replaceAll( regex, value );
        }

        return sql;
    }

}