Class AbstractConstraintProvider
- java.lang.Object
-
- com.ibm.fhir.model.constraint.spi.AbstractConstraintProvider
-
- All Implemented Interfaces:
ConstraintProvider
- Direct Known Subclasses:
AbstractModelConstraintProvider,AbstractProfileConstraintProvider
public abstract class AbstractConstraintProvider extends Object implements ConstraintProvider
An abstract base class that implements theConstraintProiderinterface
-
-
Constructor Summary
Constructors Constructor Description AbstractConstraintProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidaddConstraints(List<Constraint> constraints)Add zero or more constraints to the given list of constraints.protected abstract voidaddRemovalPredicates(List<Predicate<Constraint>> removalPredicates)Add zero or more removal predicates to the given list of removal predicates.protected Constraintconstraint(String id, String level, String location, String description, Class<? extends ConstraintValidator<?>> validationClass)Create aConstraintinstance.protected Constraintconstraint(String id, String level, String location, String description, String expression, String source)Create aConstraintinstance.protected Constraintconstraint(String id, String level, String location, String description, String expression, String source, Class<? extends ConstraintValidator<?>> validatorClass)Create aConstraintinstance.List<Constraint>getConstraints()Get the list of constraints for this constraint provider.List<Predicate<Constraint>>getRemovalPredicates()Get the list of removal predicates for this constraint provider.protected Predicate<Constraint>idEquals(String id)Create a predicate that matches on the given constraint id.protected Predicate<Constraint>locationEquals(String location)Create a predicate that matches on the given constraint location.protected Predicate<Constraint>sourceEquals(String source)Create a predicate that matches on the given constraint source.
-
-
-
Method Detail
-
getRemovalPredicates
public final List<Predicate<Constraint>> getRemovalPredicates()
Description copied from interface:ConstraintProviderGet the list of removal predicates for this constraint provider.- Specified by:
getRemovalPredicatesin interfaceConstraintProvider- Returns:
- the list of removal predicates for this constraint provider
-
getConstraints
public final List<Constraint> getConstraints()
Description copied from interface:ConstraintProviderGet the list of constraints for this constraint provider.- Specified by:
getConstraintsin interfaceConstraintProvider- Returns:
- the list of constraints for this constraint provider
-
addRemovalPredicates
protected abstract void addRemovalPredicates(List<Predicate<Constraint>> removalPredicates)
Add zero or more removal predicates to the given list of removal predicates.- Parameters:
removalPredicates- the list of removal predicates
-
addConstraints
protected abstract void addConstraints(List<Constraint> constraints)
Add zero or more constraints to the given list of constraints.- Parameters:
constraints- the list of constraints
-
idEquals
protected Predicate<Constraint> idEquals(String id)
Create a predicate that matches on the given constraint id.- Parameters:
id- the id- Returns:
- a predicate that matches on the given constraint id
- See Also:
Constraint.id()
-
locationEquals
protected Predicate<Constraint> locationEquals(String location)
Create a predicate that matches on the given constraint location.- Parameters:
location- the location- Returns:
- a predicate that matches on the given constraint location
- See Also:
Constraint.location()
-
sourceEquals
protected Predicate<Constraint> sourceEquals(String source)
Create a predicate that matches on the given constraint source.- Parameters:
source- the source- Returns:
- a predicate that matches on the given constraint source
-
constraint
protected Constraint constraint(String id, String level, String location, String description, Class<? extends ConstraintValidator<?>> validationClass)
Create aConstraintinstance.- Parameters:
id- the idlevel- the levellocation- the locationdescription- the descriptionvalidationClass- the validation class- Returns:
- a
Constraintinstance
-
constraint
protected Constraint constraint(String id, String level, String location, String description, String expression, String source)
Create aConstraintinstance.- Parameters:
id- the idlevel- the levellocation- the locationdescription- the descriptionexpression- the expressionsource- the source- Returns:
- a
Constraintinstance
-
constraint
protected Constraint constraint(String id, String level, String location, String description, String expression, String source, Class<? extends ConstraintValidator<?>> validatorClass)
Create aConstraintinstance.- Parameters:
id- the idlevel- the levellocation- the locationdescription- the descriptionexpression- the expressionsource- the sourcevalidatorClass- the validator class- Returns:
- a
Constraintinstance
-
-