/** * {@inheritDoc} */ @Override protected void executeSpecificInitialization(StringMatchingExpression expression) { if (expression.isSearchNodeInTrace() && useSearchInDepthComposite) { searchInTraceCheckBox.setSelection(true); depthSpinner.setSelection(expression.getMaxSearchDepth()); depthSpinner.setEnabled(true); } }
/** * Recursive evaluation in the invocation sequence structure if search in trace is activated. * * @param invocSequence * {@link InvocationSequenceData} forming the evaluation context * @param cachedDataService * {@link ICachedDataService} instance for retrieval of method names etc. * @param depth * current search depth in the invocation sequence tree structure * @return Returns evaluation result. */ private boolean evaluate(InvocationSequenceData invocSequence, ICachedDataService cachedDataService, int depth) { String[] strArray = getStringValueSource().getStringValues(invocSequence, cachedDataService); if (ArrayUtils.isNotEmpty(strArray)) { for (String element : strArray) { if ((null != element) && evaluateString(element)) { return true; } } } if (isSearchNodeInTrace() && ((getMaxSearchDepth() < 0) || (depth < getMaxSearchDepth()))) { for (InvocationSequenceData childNode : invocSequence.getNestedSequences()) { if (evaluate(childNode, cachedDataService, depth + 1)) { return true; } } } return false; }