Module dev.metaschema.databind
Annotation Type Report
This annotation defines a report condition in the context of the containing
annotation.
Report constraints generate findings when their test expression evaluates to
true, which is the opposite of expect constraints.
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionAn optional description of the constraint.An optional formal name for the constraint.An optional identifier for the constraint, which must be unique to only this constraint.The significance of a violation of this constraint.The message to emit when the constraint is violated.Property[]An optional set of properties associated with this constraint.Any remarks about the constraint, encoded as an escaped Markdown string.An optional metapath that points to the target flag or field value that the constraint applies to.
-
Element Details
-
test
A metapath that is expected to evaluate totruewhen a finding should be reported.This is the opposite of expect constraints - report constraints fire when the test is true.
- Returns:
- a metapath expression
-
-
-
id
An optional identifier for the constraint, which must be unique to only this constraint.- Returns:
- the identifier if provided or an empty string otherwise
- Default:
- ""
-
formalName
An optional formal name for the constraint.- Returns:
- the formal name if provided or an empty string otherwise
- Default:
- ""
-
description
An optional description of the constraint.- Returns:
- the description if provided or an empty string otherwise
- Default:
- ""
-
level
The significance of a violation of this constraint.The default level for report constraints is
IConstraint.Level.INFORMATIONAL, which differs from expect constraints that default toIConstraint.Level.ERROR.- Returns:
- the level
- Default:
- INFORMATIONAL
-
target
An optional metapath that points to the target flag or field value that the constraint applies to. If omitted the target will be ".", which means the target is the value of theBoundFlag,BoundFieldorBoundFieldValueannotation the constraint appears on. In the prior case, this annotation may only appear on aBoundFieldif the field has no flags, which results in aBoundFieldannotation on a field instance with a scalar, data type value.- Returns:
- the target metapath
- Default:
- "."
-
properties
Property[] propertiesAn optional set of properties associated with this constraint.- Returns:
- the properties or an empty array with no properties
- Default:
- {}
-
message
The message to emit when the constraint is violated.- Returns:
- the message or an empty string otherwise
- Default:
- ""
-
remarks
Any remarks about the constraint, encoded as an escaped Markdown string.- Returns:
- an encoded markdown string or an empty string if no remarks are provided
- Default:
- ""
-