public class ValidationEngine extends java.lang.Object implements IValidationEngine
ViatraQueryEngine
for tracking violations of ConstraintSpecification
s.
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()
IValidationEngine
initialize
in interface IValidationEngine
public void dispose()
IValidationEngine
dispose
in interface IValidationEngine
public java.util.Set<IConstraint> getConstraints()
IValidationEngine
getConstraints
in interface IValidationEngine
public IConstraint addConstraintSpecification(IConstraintSpecification constraintSpecification)
IValidationEngine
addConstraintSpecification
in interface IValidationEngine
constraintSpecification
- The constraint specification instance to be registered.public IConstraint removeConstraintSpecification(IConstraintSpecification constraintSpecification)
IValidationEngine
removeConstraintSpecification
in interface IValidationEngine
constraintSpecification
- The constraint specification to be deregistered.protected boolean addRuleSpecificationToExecutionSchema(Constraint constraint)
protected boolean removeRuleSpecificationFromExecutionSchema(Constraint constraint)
public java.util.Set<ValidationEngineListener> getListeners()
IValidationEngine
getListeners
in interface IValidationEngine
public boolean addListener(ValidationEngineListener listener)
IValidationEngine
addListener
in interface IValidationEngine
listener
- The listener to be registered.true
if the listener was not registered before.public boolean removeListener(ValidationEngineListener listener)
IValidationEngine
removeListener
in interface IValidationEngine
listener
- The listener to be deregistered.true
if the listener was in fact registered.protected void notifyListenersConstraintRegistered(Constraint constraint)
protected void notifyListenersConstraintDeregistered(Constraint constraint)