Module dev.metaschema.core
Interface IAllowedValuesConstraint
- All Superinterfaces:
IAttributable,IConstraint,IDescribable
Represents a rule requiring the value of a field or flag to match the name of
one entry in a set of enumerated values.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classProvides a builder pattern for constructing a newIAllowedValuesConstraint.static enumIndicates how an allowed values constraint can be extended, or if it can be.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 booleanThe default allow other value.static final IAllowedValuesConstraint.ExtensibleThe default extensible value.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.builder()Create a new constraint builder.default IAllowedValuegetAllowedValue(String name) Get a specific allowed value by name, if it is defined for this constraint.Map<String,? extends IAllowedValue> Get the collection allowed values associated with this constraint.Determines the degree to which this constraint can be extended by other constraints applied to the same value.default IConstraint.TypegetType()Get the constraint type.booleanDetermines if this allowed value constraint is open-ended (true) or closed.Methods inherited from interface dev.metaschema.core.model.IAttributable
getProperties, getPropertyValues, hasProperty, hasPropertyValueMethods 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
-
ALLOW_OTHER_DEFAULT
static final boolean ALLOW_OTHER_DEFAULTThe default allow other value.- See Also:
-
EXTENSIBLE_DEFAULT
The default extensible value.
-
-
Method Details
-
getType
Description copied from interface:IConstraintGet the constraint type.- Specified by:
getTypein interfaceIConstraint- Returns:
- the constraint type
-
getAllowedValues
Get the collection allowed values associated with this constraint.- Returns:
- a mapping of value to the associated
IAllowedValueitem
-
getAllowedValue
Get a specific allowed value by name, if it is defined for this constraint.- Parameters:
name- the value name- Returns:
- the allowed value or
nullif the value is not defined
-
isAllowedOther
boolean isAllowedOther()Determines if this allowed value constraint is open-ended (true) or closed. If "open-ended", the constraint allows the target's value to by any additional unspecified value. If "closed", the constraint requries the target's value to be one of the specified values.- Returns:
trueif the constraint is "open-ended", orfalseotherwise
-
getExtensible
Determines the degree to which this constraint can be extended by other constraints applied to the same value.- Returns:
- the enumeration value
-
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
-