use of org.drools.verifier.components.ReturnValueRestriction in project drools by kiegroup.
the class FieldConstraintDescrVisitor method visit.
/**
* End
*
* @param descr
*/
private void visit(ReturnValueRestrictionDescr descr) {
ReturnValueRestriction restriction = new ReturnValueRestriction(pattern);
restriction.setPatternIsNot(pattern.isPatternNot());
restriction.setFieldPath(field.getPath());
restriction.setOperator(Operator.determineOperator(descr.getEvaluator(), descr.isNegated()));
restriction.setClassMethodName(descr.getClassMethodName());
restriction.setContent(descr.getContent());
restriction.setDeclarations(descr.getDeclarations());
restriction.setOrderNumber(orderNumber);
restriction.setParentPath(pattern.getPath());
restriction.setParentType(pattern.getVerifierComponentType());
data.add(restriction);
solvers.addPatternComponent(restriction);
}
use of org.drools.verifier.components.ReturnValueRestriction in project drools by kiegroup.
the class VerifierDataMapsTest method testSaveVerifierComponentAndGetForAllRestrictions.
@Test
public void testSaveVerifierComponentAndGetForAllRestrictions() {
Pattern pattern = VerifierComponentMockFactory.createPattern1();
saveVerifierComponentAndGet(LiteralRestriction.createRestriction(pattern, ""));
saveVerifierComponentAndGet(new EnumRestriction(pattern));
saveVerifierComponentAndGet(new QualifiedIdentifierRestriction(pattern));
saveVerifierComponentAndGet(new ReturnValueRestriction(pattern));
saveVerifierComponentAndGet(new ReturnValueRestriction(pattern));
saveVerifierComponentAndGet(new VariableRestriction(pattern));
}
Aggregations