@SuppressWarnings("unchecked") static Map<ParameterValueStore, Map<String, Iterable<? extends WindupVertexFrame>>> getParameterValueStoreMap( final EvaluationContext context) { Map<ParameterValueStore, Map<String, Iterable<? extends WindupVertexFrame>>> cachedStores = (Map<ParameterValueStore, Map<String, Iterable<? extends WindupVertexFrame>>>) context .get(PARAM_VALUE_STORE_MAP_KEY); Map<ParameterValueStore, Map<String, Iterable<? extends WindupVertexFrame>>> valueStores = cachedStores; if (valueStores == null) valueStores = new ConcurrentHashMap<>(); return valueStores; }
@SuppressWarnings("unchecked") static Map<ParameterValueStore, Map<String, Iterable<? extends WindupVertexFrame>>> getParameterValueStoreMap( final EvaluationContext context) { Map<ParameterValueStore, Map<String, Iterable<? extends WindupVertexFrame>>> cachedStores = (Map<ParameterValueStore, Map<String, Iterable<? extends WindupVertexFrame>>>) context .get(PARAM_VALUE_STORE_MAP_KEY); Map<ParameterValueStore, Map<String, Iterable<? extends WindupVertexFrame>>> valueStores = cachedStores; if (valueStores == null) valueStores = new ConcurrentHashMap<>(); return valueStores; }
@SuppressWarnings("unchecked") static Map<WindupVertexFrame, ParameterValueStore> getResultValueStoreMap(EvaluationContext context) { Map<WindupVertexFrame, ParameterValueStore> result = (Map<WindupVertexFrame, ParameterValueStore>) context .get(RESULT_VALUE_STORE_MAP_KEY); if (result == null) { result = new LinkedHashMap<>(); } return result; }
@SuppressWarnings("unchecked") static Map<WindupVertexFrame, ParameterValueStore> getResultValueStoreMap(EvaluationContext context) { Map<WindupVertexFrame, ParameterValueStore> result = (Map<WindupVertexFrame, ParameterValueStore>) context .get(RESULT_VALUE_STORE_MAP_KEY); if (result == null) { result = new LinkedHashMap<>(); } return result; }
/** * Retrieve the current {@link ParameterStore} from the given {@link EvaluationContext} instance. * * @throws IllegalStateException If the {@link ParameterValueStore} could not be located. */ public static ParameterStore getInstance(EvaluationContext context) throws IllegalStateException { ParameterStore store = (ParameterStore) context.get(ParameterStore.class); if (store == null) { throw new IllegalStateException("Could not retrieve " + ParameterStore.class.getName() + " from " + EvaluationContext.class.getName() + ". Has the " + EvaluationContext.class.getSimpleName() + " been set up properly?"); } return store; } }
@Override public boolean evaluate(GraphRewrite event, EvaluationContext context) { ParameterStore store = (ParameterStore) context.get(ParameterStore.class); ParameterValueStore values = (ParameterValueStore) context.get(ParameterValueStore.class); boolean result = values.submit(event, context, store.get(name), value); return result; }
@Override public boolean evaluate(GraphRewrite event, EvaluationContext context) { ParameterStore store = (ParameterStore) context.get(ParameterStore.class); ParameterValueStore values = (ParameterValueStore) context.get(ParameterValueStore.class); boolean result = values.submit(event, context, store.get(name), value); return result; }
@Override public Object get(Object key) { Object result = super.get(key); if (result == null && parent != null) result = parent.get(key); return result; }
@Override public boolean evaluate(GraphRewrite event, EvaluationContext context) { ParameterStore store = (ParameterStore) context.get(ParameterStore.class); ParameterValueStore values = (ParameterValueStore) context.get(ParameterValueStore.class); boolean result = values.submit(event, context, store.get(name), value); return result; }
public ClassificationModel attachClassification(GraphRewrite event, EvaluationContext context, FileModel fileModel, String categoryId, String classificationText, String description) { Rule rule = (Rule) context.get(Rule.class); return attachClassification(event, rule, fileModel, categoryId, classificationText, description); }
/** * Retrieve a single parameter value from the {@link ParameterValueStore}. */ public static String retrieve(EvaluationContext context, String string) { return ((ParameterValueStore) context.get(ParameterValueStore.class)).retrieve(((ParameterStore) context .get(ParameterStore.class)).get(string)); } }
/** * Retrieve a single parameter value from the {@link ParameterValueStore}. */ public static String retrieve(EvaluationContext context, String string) { return ((ParameterValueStore) context.get(ParameterValueStore.class)).retrieve(((ParameterStore) context .get(ParameterStore.class)).get(string)); } }
public ClassificationModel attachClassification(GraphRewrite event, EvaluationContext context, FileModel fileModel, String categoryId, String classificationText, String description) { Rule rule = (Rule) context.get(Rule.class); return attachClassification(event, rule, fileModel, categoryId, classificationText, description); }
@Override public Object get(Object key) { Object result = super.get(key); if (result == null && parent != null) result = parent.get(key); return result; }
public boolean hasValue(final Rewrite event, final EvaluationContext context) { return context.get(getParameterUnconvertedName(property)) != null; }
public boolean hasValue(final Rewrite event, final EvaluationContext context) { return context.get(getParameterUnconvertedName(property)) != null; }
@Override public void perform(GraphRewrite event, EvaluationContext context, FileLocationModel payload) { GraphContext graphContext = event.getGraphContext(); GraphService<OverviewReportLineMessageModel> overviewLineService = new GraphService<>(graphContext, OverviewReportLineMessageModel.class); OverviewReportLineMessageModel overviewLine = overviewLineService.create(); overviewLine.setMessage(message); ProjectModel projectModel = payload.getFile().getProjectModel(); overviewLine.setProject(projectModel); overviewLine.setRuleID(((Rule) context.get(Rule.class)).getId()); }
@Override public void perform(GraphRewrite event, EvaluationContext context, FileLocationModel payload) { GraphContext graphContext = event.getGraphContext(); GraphService<OverviewReportLineMessageModel> overviewLineService = new GraphService<>(graphContext, OverviewReportLineMessageModel.class); OverviewReportLineMessageModel overviewLine = overviewLineService.create(); overviewLine.setMessage(message); ProjectModel projectModel = payload.getFile().getProjectModel(); overviewLine.setProject(projectModel); overviewLine.setRuleID(((Rule) context.get(Rule.class)).getId()); }