/** * {@inheritDoc} */ @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = (prime * result) + ((this.injectionStrategy == null) ? 0 : this.injectionStrategy.hashCode()); result = (prime * result) + ((this.type == null) ? 0 : this.type.hashCode()); return result; }
/** * {@inheritDoc} * * @throws RuleExecutionException * If tag injection fails. */ @Override public Object determineValueToInject(ExecutionContext context) throws RuleExecutionException { // extract the required type form the unraveled list of input Tags for (Tag tag : context.getRuleInput().getUnraveled()) { if (tag.getType().equals(getType())) { return InjectionStrategy.BY_VALUE.equals(getInjectionStrategy()) ? tag.getValue() : tag; } } throw new RuleExecutionException("Unable to find Tag: " + getType() + " in RuleInput.", context); }