- All Superinterfaces:
IAttributable,IConfigurableMessageConstraint,IConstraint,IDescribable
Represents a rule reporting a condition when a Metaschema assembly, field, or
flag data instance matches a Metapath-based test.
Unlike IExpectConstraint which generates a finding when the test is
FALSE, a report constraint generates a finding when the test is TRUE. This is
useful for:
- Reporting deprecated usage patterns
- Flagging known issues or limitations
- Providing informational messages about content
A custom message can be used to indicate what a matching condition signifies.
The default severity level is IConstraint.Level.INFORMATIONAL.
- Since:
- 2.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classProvides a builder pattern for constructing a newIReportConstraint.Nested classes/interfaces inherited from interface dev.metaschema.core.model.IAttributable
IAttributable.KeyNested classes/interfaces inherited from interface dev.metaschema.core.model.constraint.IConstraint
IConstraint.Level, IConstraint.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IConstraint.LevelThe default severity level for report constraints.Fields inherited from interface dev.metaschema.core.model.IAttributable
DEFAULT_PROPERY_NAMESPACE -
Method Summary
Modifier and TypeMethodDescriptiondefault <T,R> R accept(IConstraintVisitor<T, R> visitor, T state) Used for double dispatch supporting the visitor pattern provided by implementations ofIConstraintVisitor.static IReportConstraint.Builderbuilder()Create a new constraint builder.getTest()Get the test to use to identify reportable conditions in selected nodes.default IConstraint.TypegetType()Get the constraint type.Methods inherited from interface dev.metaschema.core.model.IAttributable
getProperties, getPropertyValues, hasProperty, hasPropertyValueMethods inherited from interface dev.metaschema.core.model.constraint.IConfigurableMessageConstraint
generateMessage, getMessageMethods inherited from interface dev.metaschema.core.model.constraint.IConstraint
getId, getLevel, getRemarks, getSource, getTarget, matchTargetsMethods inherited from interface dev.metaschema.core.model.IDescribable
getDescription, getEffectiveDescription, getEffectiveFormalName, getFormalName
-
Field Details
-
DEFAULT_LEVEL
The default severity level for report constraints.
-
-
Method Details
-
getType
Description copied from interface:IConstraintGet the constraint type.- Specified by:
getTypein interfaceIConstraint- Returns:
- the constraint type
-
getTest
Get the test to use to identify reportable conditions in selected nodes.A finding is generated when this test evaluates to
true.- Returns:
- the test metapath expression to use
-
accept
Description copied from interface:IConstraintUsed for double dispatch supporting the visitor pattern provided by implementations ofIConstraintVisitor.- Specified by:
acceptin interfaceIConstraint- Type Parameters:
T- the Java type of a state object passed to the visitorR- the Java type of the result returned by the visitor methods- Parameters:
visitor- the visitor implementationstate- the state object passed to the visitor- Returns:
- the visitation result
- See Also:
-
builder
Create a new constraint builder.- Returns:
- the builder
-