/** * Initialize the {@link Parameterized} instance with the {@link ParameterStore} from the given * {@link EvaluationContext}, also record required parameter names in the {@link ParameterStore} and initialize with * a new {@link Parameter} instance. */ public static void initialize(EvaluationContext context, Object parameterized) { initialize(DefaultParameterStore.getInstance(context), parameterized); }
private RuleBuilder() { store = new DefaultParameterStore(); }
@SuppressWarnings("unchecked") public DefaultParameterStore() { if (providers == null) { providers = Iterators.asList(ServiceLoader.load(GlobalParameterProvider.class)); ServiceLogger.logLoadedServices(log, GlobalParameterProvider.class, providers); } for (GlobalParameterProvider provider : providers) { Set<Parameter<?>> params = provider.getParameters(); if (params != null) { for (Parameter<?> parameter : params) store(parameter); } } }
@SuppressWarnings("unchecked") public DefaultParameterStore() { if (providers == null) { providers = Iterators.asList(ServiceLoader.load(GlobalParameterProvider.class)); ServiceLogger.logLoadedServices(log, GlobalParameterProvider.class, providers); } for (GlobalParameterProvider provider : providers) { Set<Parameter<?>> params = provider.getParameters(); if (params != null) { for (Parameter<?> parameter : params) store(parameter); } } }
/** * Initialize the {@link Parameterized} instance with the {@link ParameterStore} from the given * {@link EvaluationContext}, also record required parameter names in the {@link ParameterStore} and initialize with * a new {@link Parameter} instance. */ public static void initialize(EvaluationContext context, Object parameterized) { initialize(DefaultParameterStore.getInstance(context), parameterized); }
private RuleBuilder() { store = new DefaultParameterStore(); }
@Override public boolean isValid(GraphRewrite event,EvaluationContext context, XmlFileModel model) { if (fileNamePattern != null) { final ParameterStore store = DefaultParameterStore.getInstance(context); Pattern compiledPattern = fileNamePattern.getCompiledPattern(store); String pattern = compiledPattern.pattern(); String fileName = model.getFileName(); if (!fileName.matches(pattern)) { return false; } return true; } return true; }
public DefaultEvaluationContext() { put(ParameterStore.class, new DefaultParameterStore()); parent = null; }
@Override public Map<Parameter<?>, String> getParameters(EvaluationContext context) { Map<Parameter<?>, String> values = new LinkedHashMap<Parameter<?>, String>(); ParameterStore store = DefaultParameterStore.getInstance(context); if (matcher.matches()) { for (RegexGroup group : groups) { values.put(store.get(group.getName()), matcher.group(group.getIndex() + 1)); } } return values; }
public DefaultEvaluationContext() { put(ParameterStore.class, new DefaultParameterStore()); parent = null; }
@Override public Map<Parameter<?>, String> getParameters(EvaluationContext context) { Map<Parameter<?>, String> values = new LinkedHashMap<Parameter<?>, String>(); ParameterStore store = DefaultParameterStore.getInstance(context); if (matcher.matches()) { for (RegexGroup group : groups) { values.put(store.get(group.getName()), matcher.group(group.getIndex() + 1)); } } return values; }
public EvaluationContextImpl() { put(ParameterStore.class, new DefaultParameterStore()); }
@Override public boolean isValid(Rewrite event, EvaluationContext context) { if (matches()) { ParameterStore store = DefaultParameterStore.getInstance(context); int index = 1; for (RegexGroup group : groups) { String value = matcher.group(index++); Parameter<?> param = store.get(group.getName()); ParameterValueStore valueStore = DefaultParameterValueStore.getInstance(context); if (!valueStore.isValid(event, context, param, value)) { return false; } } return true; } return false; }
public EvaluationContextImpl() { put(ParameterStore.class, new DefaultParameterStore()); }
@Override public boolean isValid(Rewrite event, EvaluationContext context) { if (matches()) { ParameterStore store = DefaultParameterStore.getInstance(context); int index = 1; for (RegexGroup group : groups) { String value = matcher.group(index++); Parameter<?> param = store.get(group.getName()); ParameterValueStore valueStore = DefaultParameterValueStore.getInstance(context); if (!valueStore.isValid(event, context, param, value)) { return false; } } return true; } return false; }
public EvaluationContextImpl() { put(ParameterStore.class, new DefaultParameterStore()); }
@Override public boolean submit(Rewrite event, EvaluationContext context) { if (matches()) { ParameterStore store = DefaultParameterStore.getInstance(context); int index = 1; for (RegexGroup group : groups) { String value = matcher.group(index++); Parameter<?> param = store.get(group.getName()); ParameterValueStore valueStore = DefaultParameterValueStore.getInstance(context); if (!valueStore.submit(event, context, param, value)) { return false; } } return true; } return false; }
public EvaluationContextImpl() { put(ParameterStore.class, new DefaultParameterStore()); }
@Override public boolean submit(Rewrite event, EvaluationContext context) { if (matches()) { ParameterStore store = DefaultParameterStore.getInstance(context); int index = 1; for (RegexGroup group : groups) { String value = matcher.group(index++); Parameter<?> param = store.get(group.getName()); ParameterValueStore valueStore = DefaultParameterValueStore.getInstance(context); if (!valueStore.submit(event, context, param, value)) { return false; } } return true; } return false; }
public EvaluationContextImpl() { put(ParameterStore.class, new DefaultParameterStore()); }