Module dev.metaschema.core
Class IReportConstraint.Builder
java.lang.Object
dev.metaschema.core.model.constraint.AbstractConstraintBuilder<T,R>
dev.metaschema.core.model.constraint.AbstractConfigurableMessageConstraintBuilder<IReportConstraint.Builder,IReportConstraint>
dev.metaschema.core.model.constraint.IReportConstraint.Builder
- Enclosing interface:
- IReportConstraint
public static final class IReportConstraint.Builder
extends AbstractConfigurableMessageConstraintBuilder<IReportConstraint.Builder,IReportConstraint>
Provides a builder pattern for constructing a new
IReportConstraint.-
Method Summary
Modifier and TypeMethodDescriptionprotected IConstraint.LevelgetLevel()Get the constraint severity level provided to the builder.protected IReportConstraint.BuildergetThis()Get the builder.level(IConstraint.Level level) Set the severity level for when the constraint is violated.protected IReportConstraintGet a new instance of the built object.test(IMetapathExpression test) Use the provided test to identify reportable conditions in selected nodes.protected voidvalidate()Validate the values provided to the builder.Methods inherited from class dev.metaschema.core.model.constraint.AbstractConfigurableMessageConstraintBuilder
getMessage, messageMethods inherited from class dev.metaschema.core.model.constraint.AbstractConstraintBuilder
build, description, formalName, getDescription, getFormalName, getId, getProperties, getRemarks, getSource, getTarget, identifier, properties, property, property, remarks, source, target
-
Method Details
-
test
Use the provided test to identify reportable conditions in selected nodes.A finding is generated when this test evaluates to
true.- Parameters:
test- the test metapath expression to use- Returns:
- this builder
-
getThis
Description copied from class:AbstractConstraintBuilderGet the builder.Implementations of this method must return
this.- Specified by:
getThisin classAbstractConstraintBuilder<IReportConstraint.Builder,IReportConstraint> - Returns:
- the builder instance
-
level
Set the severity level for when the constraint is violated.For report constraints, the default level is
IConstraint.Level.INFORMATIONALif no level is explicitly set.- Overrides:
levelin classAbstractConstraintBuilder<IReportConstraint.Builder,IReportConstraint> - Parameters:
level- the level to set- Returns:
- this builder
-
getLevel
Description copied from class:AbstractConstraintBuilderGet the constraint severity level provided to the builder.- Overrides:
getLevelin classAbstractConstraintBuilder<IReportConstraint.Builder,IReportConstraint> - Returns:
- the severity level
-
validate
protected void validate()Description copied from class:AbstractConstraintBuilderValidate the values provided to the builder.- Overrides:
validatein classAbstractConstraintBuilder<IReportConstraint.Builder,IReportConstraint>
-
newInstance
Description copied from class:AbstractConstraintBuilderGet a new instance of the built object.- Specified by:
newInstancein classAbstractConstraintBuilder<IReportConstraint.Builder,IReportConstraint> - Returns:
- the built instance
-