public class ValidationEngine extends java.lang.Object implements IValidationEngine
ViatraQueryEngine for tracking violations of ConstraintSpecifications.
Use the builder() method for setting up a new instance through the ValidationEngineBuilder.| Modifier | Constructor and Description |
|---|---|
protected |
ValidationEngine(ViatraQueryEngine engine,
org.apache.log4j.Logger logger) |
| Modifier and Type | Method and Description |
|---|---|
IConstraint |
addConstraintSpecification(IConstraintSpecification constraintSpecification)
Adds the given constraint specification to the validation engine and returns the created constraint.
|
boolean |
addListener(ValidationEngineListener listener)
Adds the given listener to the list of listeners to be notified on specific events regarding the validation
engine.
|
protected boolean |
addRuleSpecificationToExecutionSchema(Constraint constraint) |
static ValidationEngineBuilder |
builder() |
void |
dispose()
Disposes the validation engine.
|
java.util.Set<IConstraint> |
getConstraints()
Returns the constraints to the registered constraint specifications.
|
protected ExecutionSchema |
getExecutionSchema() |
java.util.Set<ValidationEngineListener> |
getListeners()
Returns the listeners registered for the validation engine.
|
protected ViatraQueryEngine |
getQueryEngine() |
void |
initialize()
Initializes the validation engine.
|
protected void |
notifyListenersConstraintDeregistered(Constraint constraint) |
protected void |
notifyListenersConstraintRegistered(Constraint constraint) |
IConstraint |
removeConstraintSpecification(IConstraintSpecification constraintSpecification)
Removes the given constraint specification from the validation engine and returns the corresponding constraint.
|
boolean |
removeListener(ValidationEngineListener listener)
Removes the given listener from the list of listeners to be notified on specific events regarding the validation
engine.
|
protected boolean |
removeRuleSpecificationFromExecutionSchema(Constraint constraint) |
protected ValidationEngine(ViatraQueryEngine engine, org.apache.log4j.Logger logger)
protected ViatraQueryEngine getQueryEngine()
protected ExecutionSchema getExecutionSchema()
public static ValidationEngineBuilder builder()
public void initialize()
IValidationEngineinitialize in interface IValidationEnginepublic void dispose()
IValidationEnginedispose in interface IValidationEnginepublic java.util.Set<IConstraint> getConstraints()
IValidationEnginegetConstraints in interface IValidationEnginepublic IConstraint addConstraintSpecification(IConstraintSpecification constraintSpecification)
IValidationEngineaddConstraintSpecification in interface IValidationEngineconstraintSpecification - The constraint specification instance to be registered.public IConstraint removeConstraintSpecification(IConstraintSpecification constraintSpecification)
IValidationEngineremoveConstraintSpecification in interface IValidationEngineconstraintSpecification - The constraint specification to be deregistered.protected boolean addRuleSpecificationToExecutionSchema(Constraint constraint)
protected boolean removeRuleSpecificationFromExecutionSchema(Constraint constraint)
public java.util.Set<ValidationEngineListener> getListeners()
IValidationEnginegetListeners in interface IValidationEnginepublic boolean addListener(ValidationEngineListener listener)
IValidationEngineaddListener in interface IValidationEnginelistener - The listener to be registered.true if the listener was not registered before.public boolean removeListener(ValidationEngineListener listener)
IValidationEngineremoveListener in interface IValidationEnginelistener - The listener to be deregistered.true if the listener was in fact registered.protected void notifyListenersConstraintRegistered(Constraint constraint)
protected void notifyListenersConstraintDeregistered(Constraint constraint)