Package com.ibm.fhir.model.annotation
Annotation Type Constraint
-
@Repeatable(Constraints.class) @Target(TYPE) @Retention(RUNTIME) public @interface Constraint
An annotation interface that represents a formal constraint (invariant)Constraints can be computationally evaluated using a FHIRPath engine or an instance of
ConstraintValidator.
-
-
Field Summary
Fields Modifier and Type Fields Description static java.lang.StringLEVEL_RULEstatic java.lang.StringLEVEL_WARNINGstatic java.lang.StringLOCATION_BASEstatic java.lang.StringSOURCE_UNKNOWN
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.StringdescriptionA description used in messages identifying that the constraint has been violatedjava.lang.StringexpressionA FHIRPath expression that must evaluate to true when run on the validation targetElementorResourcejava.lang.StringidIdentifies the constraint uniquely amongst all the constraints in the contextjava.lang.StringlevelThe severity of the constraintjava.lang.StringlocationThe location (path) of the validation targetElementorResourcejava.lang.StringsourceThe original source of the constraint
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleangeneratedIndicates whether the constraint was generatedbooleanmodelCheckedIndicates whether the constraint is checked in the modeljava.lang.Class<? extends ConstraintValidator<?>>validatorClassTheConstraintValidatorclass used to validate this constraint
-
-
-
Element Detail
-
id
java.lang.String id
Identifies the constraint uniquely amongst all the constraints in the context- Returns:
- the id
- See Also:
ElementDefinition.Constraint.getKey()
-
-
-
level
java.lang.String level
The severity of the constraint- Returns:
- the level
- See Also:
ElementDefinition.Constraint.getSeverity()
-
-
-
location
java.lang.String location
The location (path) of the validation targetElementorResource- Returns:
- the location
- See Also:
ElementDefinition.getPath()
-
-
-
description
java.lang.String description
A description used in messages identifying that the constraint has been violated- Returns:
- the description
- See Also:
ElementDefinition.Constraint.getHuman()
-
-
-
expression
java.lang.String expression
A FHIRPath expression that must evaluate to true when run on the validation targetElementorResource- Returns:
- the expression
- See Also:
ElementDefinition.Constraint.getExpression()
-
-
-
source
java.lang.String source
The original source of the constraint- Returns:
- the source
- See Also:
ElementDefinition.Constraint.getSource()
-
-
-
validatorClass
java.lang.Class<? extends ConstraintValidator<?>> validatorClass
TheConstraintValidatorclass used to validate this constraint- Returns:
- the
ConstraintValidatorclass used to validate this constraint
- Default:
- com.ibm.fhir.model.annotation.Constraint.FHIRPathConstraintValidator.class
-
-