java.lang.Object
dev.metaschema.core.model.constraint.ValueConstraintSet
- All Implemented Interfaces:
IValueConstrained
- Direct Known Subclasses:
AssemblyConstraintSet
A container of rules constraining the effective model of a Metaschema field
or flag data instance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddConstraint(IAllowedValuesConstraint constraint) Add a new constraint.final voidaddConstraint(IExpectConstraint constraint) Add a new constraint.final voidaddConstraint(IIndexHasKeyConstraint constraint) Add a new constraint.final voidaddConstraint(IMatchesConstraint constraint) Add a new constraint.final voidaddConstraint(IReportConstraint constraint) Add a new constraint.addLetExpression(ILet let) Add a new let expression.Get the collection of allowed value constraints, if any.Retrieve the ordered collection of constraints.protected List<IConstraint>Get the underlying constraint collection.Get the collection of expect constraints, if any.Get the collection of index key reference constraints, if any.Get the collection of let expressions, if any.protected ReadWriteLockgetLock()Get the read-write lock used to manage access to the underlying constraint collections.Get the collection of matches constraints, if any.Get the collection of report constraints, if any.Get information about the resource the constraints were loaded from.
-
Constructor Details
-
ValueConstraintSet
Construct a new constraint set.- Parameters:
source- information about the resource the constraints were loaded from
-
-
Method Details
-
getSource
Description copied from interface:IValueConstrainedGet information about the resource the constraints were loaded from.- Specified by:
getSourcein interfaceIValueConstrained- Returns:
- the source information
-
getLock
Get the read-write lock used to manage access to the underlying constraint collections.This can be used by extending classes to control read/write access to constraint data, supporting multi-threaded access.
- Returns:
- the lock
-
getConstraintsInternal
Get the underlying constraint collection.Access to the returned collection is not thread safe. Callers should use
getLock()to get the read/write lock for managing access.- Returns:
- the constraint collection
-
getLetExpressions
Description copied from interface:IValueConstrainedGet the collection of let expressions, if any.- Specified by:
getLetExpressionsin interfaceIValueConstrained- Returns:
- the constraints or an empty list
-
addLetExpression
Description copied from interface:IValueConstrainedAdd a new let expression.- Specified by:
addLetExpressionin interfaceIValueConstrained- Parameters:
let- the let statement to add- Returns:
- the original let with the same name or
nullif no let existed with the same name
-
getConstraints
Description copied from interface:IValueConstrainedRetrieve the ordered collection of constraints.- Specified by:
getConstraintsin interfaceIValueConstrained- Returns:
- the constraints or an empty list
-
getAllowedValuesConstraints
Description copied from interface:IValueConstrainedGet the collection of allowed value constraints, if any.- Specified by:
getAllowedValuesConstraintsin interfaceIValueConstrained- Returns:
- the constraints or an empty list
-
getMatchesConstraints
Description copied from interface:IValueConstrainedGet the collection of matches constraints, if any.- Specified by:
getMatchesConstraintsin interfaceIValueConstrained- Returns:
- the constraints or an empty list
-
getIndexHasKeyConstraints
Description copied from interface:IValueConstrainedGet the collection of index key reference constraints, if any.- Specified by:
getIndexHasKeyConstraintsin interfaceIValueConstrained- Returns:
- the constraints or an empty list
-
getExpectConstraints
Description copied from interface:IValueConstrainedGet the collection of expect constraints, if any.- Specified by:
getExpectConstraintsin interfaceIValueConstrained- Returns:
- the constraints or an empty list
-
getReportConstraints
Description copied from interface:IValueConstrainedGet the collection of report constraints, if any.- Specified by:
getReportConstraintsin interfaceIValueConstrained- Returns:
- the constraints or an empty list
-
addConstraint
Description copied from interface:IValueConstrainedAdd a new constraint.- Specified by:
addConstraintin interfaceIValueConstrained- Parameters:
constraint- the constraint to add
-
addConstraint
Description copied from interface:IValueConstrainedAdd a new constraint.- Specified by:
addConstraintin interfaceIValueConstrained- Parameters:
constraint- the constraint to add
-
addConstraint
Description copied from interface:IValueConstrainedAdd a new constraint.- Specified by:
addConstraintin interfaceIValueConstrained- Parameters:
constraint- the constraint to add
-
addConstraint
Description copied from interface:IValueConstrainedAdd a new constraint.- Specified by:
addConstraintin interfaceIValueConstrained- Parameters:
constraint- the constraint to add
-
addConstraint
Description copied from interface:IValueConstrainedAdd a new constraint.- Specified by:
addConstraintin interfaceIValueConstrained- Parameters:
constraint- the constraint to add
-