<commit_before>package reactor.spring.selector;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.expression.BeanFactoryResolver;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.Expression;
import org.springframework.expression.spel.SpelCompilerMode;
import org.springframework.expression.spel.SpelParserConfiguration;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import reactor.bus.selector.ObjectSelector;
import reactor.bus.selector.Selector;

/**
 * An implementation of {@link reactor.bus.selector.Selector} that uses a SpEL expression to evaluate the match.
 *
 * @author <NAME>
 */
public class ExpressionSelector extends ObjectSelector<Expression> {

	private static final SpelExpressionParser SPEL_PARSER = new SpelExpressionParser();

	private final EvaluationContext evalCtx;

	public ExpressionSelector(Expression expr, EvaluationContext evalCtx) {
		super(expr);
		this.evalCtx = evalCtx;
	}

	@Override
	public boolean matches(Object key) {
		return getObject().getValue(evalCtx, key, Boolean.class);
	}
<commit_msg>Update Selector and Registration generics<commit_after>package reactor.spring.selector;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.expression.BeanFactoryResolver;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.Expression;
import org.springframework.expression.spel.SpelCompilerMode;
import org.springframework.expression.spel.SpelParserConfiguration;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import reactor.bus.selector.ObjectSelector;
import reactor.bus.selector.Selector;

/**
 * An implementation of {@link reactor.bus.selector.Selector} that uses a SpEL expression to evaluate the match.
 *
 * @author <NAME>
 */
public class ExpressionSelector extends ObjectSelector<Object, Expression> {

	private static final SpelExpressionParser SPEL_PARSER = new SpelExpressionParser();

	private final EvaluationContext evalCtx;

	public ExpressionSelector(Expression expr, EvaluationContext evalCtx) {
		super(expr);
		this.evalCtx = evalCtx;
	}

	@Override
	public boolean matches(Object key) {
		return getObject().getValue(evalCtx, key, Boolean.class);
	}

{'fraction_non_alphanumeric': 0.08494363929146538, 'fraction_numerical': 0.0, 'mean_word_length': 6.863924050632911, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6747155', 'n_tokens_mistral': 646, 'n_tokens_neox': 626, 'n_words': 147}