/** * * {@inheritDoc} */ @Override protected boolean isValidExpression(StringMatchingExpression expression) { return expression.getStringValueSource() instanceof HttpServerPortValueSource; } }
/** * * {@inheritDoc} */ @Override protected boolean isValidExpression(StringMatchingExpression expression) { return expression.getStringValueSource() instanceof HttpQueryStringValueSource; } }
@Override protected boolean isValidExpression(StringMatchingExpression expression) { return expression.getStringValueSource() instanceof HostValueSource; }
/** * {@inheritDoc} */ @Override protected boolean isValidExpression(StringMatchingExpression expression) { return expression.getStringValueSource() instanceof MethodParameterValueSource; }
/** * * {@inheritDoc} */ @Override protected boolean isValidExpression(StringMatchingExpression expression) { return expression.getStringValueSource() instanceof HttpParameterValueSource; }
/** * * {@inheritDoc} */ @Override protected boolean isValidExpression(StringMatchingExpression expression) { return expression.getStringValueSource() instanceof HttpUriValueSource; } }
/** * {@inheritDoc} */ @Override protected boolean isValidExpression(StringMatchingExpression expression) { return expression.getStringValueSource() instanceof AgentNameValueSource; }
/** * * {@inheritDoc} */ @Override protected boolean isValidExpression(StringMatchingExpression expression) { return expression.getStringValueSource() instanceof HttpServerNameValueSource; } }
/** * * {@inheritDoc} */ @Override protected boolean isValidExpression(StringMatchingExpression expression) { return expression.getStringValueSource() instanceof HttpSchemeValueSource; } }
/** * * {@inheritDoc} */ @Override protected boolean isValidExpression(StringMatchingExpression expression) { return expression.getStringValueSource() instanceof HttpUrlValueSource; }
@Override protected boolean isValidExpression(StringMatchingExpression expression) { return expression.getStringValueSource() instanceof MethodSignatureValueSource; }
/** * Returns true, if the given expression is a valid expression for this editing element. * * @param expression * {@link AbstractExpression} to check. * @return true, if the given expression is a valid expression for this editing element. * Otherwise, false. */ protected boolean isValidExpression(StringMatchingExpression expression) { return expression.getStringValueSource().hasOptions() && (expression.getStringValueSource().getOptions().length > 0); }
/** * Retrieves the {@link MatchingRuleType} of the passed {@link AbstractExpression}. * * @param expression * {@link AbstractExpression} to retrieve the {@link MatchingRuleType} from * @return the {@link MatchingRuleType} of the passed {@link AbstractExpression}. */ public static MatchingRuleType getMatchingRuleType(AbstractExpression expression) { if (expression instanceof StringMatchingExpression) { StringValueSource source = ((StringMatchingExpression) expression).getStringValueSource(); return getMatchingRuleType(source); } throw new IllegalArgumentException("Unsupported expression type!"); }
boolean editable, AbstractValidationManager<AbstractExpression> upstreamValidationManager) { super(expression, ruleType, description, useSearchInTrace, editable, upstreamValidationManager); if (null == expression.getStringValueSource()) { throw new IllegalArgumentException("String value source of the expression must not be null!"); this.stringValueSource = (T) expression.getStringValueSource(); } else { throw new IllegalArgumentException("Invalid String Matching Expression type!");
AbstractValidationManager<AbstractExpression> upstreamValidationManager) { super(expression, ruleType, description, useSearchInTrace, editable, upstreamValidationManager); if (null == expression.getStringValueSource()) { throw new IllegalArgumentException("String value source of the expression must not be null!"); this.stringValueSource = (T) expression.getStringValueSource(); } else { throw new IllegalArgumentException("Invalid String Matching Expression type!");
/** * Validates the contents of the passed {@link StringMatchingExpression} without the need to * create corresponding editing controls. * * @param expression * {@link StringMatchingExpression} to validate * @return a set of {@link ValidationState} instances. */ public static Set<ValidationState> validate(StringMatchingExpression expression) { Set<ValidationState> resultSet = new HashSet<>(); HttpParameterValueSource httpParameterValueSource = (HttpParameterValueSource) expression.getStringValueSource(); if (StringUtils.isBlank(httpParameterValueSource.getParameterName())) { resultSet.add(new ValidationState(PARAMETER_NAME_VALIDATOR_ID, false, PARAMETER_NAME_VALIDATION_ERROR_MESSAGE)); } resultSet.addAll(AbstractStringMatchingRuleEditingElement.validate(expression, SOURCE_NAME)); return resultSet; }
/** * Validates the contents of the passed {@link StringMatchingExpression} without the need to * create corresponding editing controls. * * @param expression * {@link StringMatchingExpression} to validate * @return a set of {@link ValidationState} instances. */ public static Set<ValidationState> validate(StringMatchingExpression expression) { Set<ValidationState> resultSet = new HashSet<>(); MethodParameterValueSource methodParameterValueSource = (MethodParameterValueSource) expression.getStringValueSource(); FqnMethodSignatureValidator methodSignatureValidator = new FqnMethodSignatureValidator(false); String errorMessage = methodSignatureValidator.isValid(methodParameterValueSource.getMethodSignature()); if (null != errorMessage) { resultSet.add(new ValidationState(METHOD_PARAMETER_NAME_VALIDATOR_ID, false, errorMessage)); } resultSet.addAll(AbstractStringMatchingRuleEditingElement.validate(expression, SOURCE_NAME)); return resultSet; }
/** * 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; }