Class AbstractConstraint
- java.lang.Object
-
- gov.nist.secauto.metaschema.core.model.constraint.AbstractConstraint
-
- All Implemented Interfaces:
IConstraint
- Direct Known Subclasses:
AbstractKeyConstraint
,DefaultAllowedValuesConstraint
,DefaultCardinalityConstraint
,DefaultExpectConstraint
,DefaultMatchesConstraint
public abstract class AbstractConstraint extends Object implements IConstraint
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractConstraint.AbstractConstraintBuilder<T extends AbstractConstraint.AbstractConstraintBuilder<T,R>,R extends AbstractConstraint>
-
Nested classes/interfaces inherited from interface gov.nist.secauto.metaschema.core.model.constraint.IConstraint
IConstraint.ExternalModelSource, IConstraint.ExternalSource, IConstraint.InternalModelSource, IConstraint.ISource, IConstraint.Level
-
-
Field Summary
-
Fields inherited from interface gov.nist.secauto.metaschema.core.model.constraint.IConstraint
DEFAULT_LEVEL, DEFAULT_TARGET, DEFAULT_TARGET_METAPATH
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractConstraint(String id, String formalName, MarkupLine description, IConstraint.ISource source, IConstraint.Level level, MetapathExpression target, Map<QName,Set<String>> properties, MarkupMultiline remarks)
Construct a new Metaschema constraint.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MarkupLine
getDescription()
String
getFormalName()
String
getId()
Retrieve the unique identifier for the constraint.IConstraint.Level
getLevel()
The significance of a violation of this constraint.Map<QName,Set<String>>
getProperties()
MarkupMultiline
getRemarks()
Retrieve the remarks associated with the constraint.IConstraint.ISource
getSource()
Get information about the source of the constraint.MetapathExpression
getTarget()
Retrieve the Metapath expression to use to query the targets of the constraint.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.constraint.IConstraint
accept, matchTargets, matchTargets
-
-
-
-
Constructor Detail
-
AbstractConstraint
protected AbstractConstraint(@Nullable String id, @Nullable String formalName, @Nullable MarkupLine description, @NonNull IConstraint.ISource source, @NonNull IConstraint.Level level, @NonNull MetapathExpression target, @NonNull Map<QName,Set<String>> properties, @Nullable MarkupMultiline remarks)
Construct a new Metaschema constraint.- Parameters:
id
- the optional identifier for the constraintformalName
- the constraint's formal name ornull
if not provideddescription
- the constraint's semantic description ornull
if not providedsource
- information about the constraint sourcelevel
- the significance of a violation of this constrainttarget
- the Metapath expression identifying the nodes the constraint targetsproperties
- a collection of associated propertiesremarks
- optional remarks describing the intent of the constraint
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:IConstraint
Retrieve the unique identifier for the constraint.- Specified by:
getId
in interfaceIConstraint
- Returns:
- the identifier or
null
if no identifier is defined
-
getDescription
public MarkupLine getDescription()
- Specified by:
getDescription
in interfaceIConstraint
-
getFormalName
public String getFormalName()
- Specified by:
getFormalName
in interfaceIConstraint
-
getSource
public IConstraint.ISource getSource()
Description copied from interface:IConstraint
Get information about the source of the constraint.- Specified by:
getSource
in interfaceIConstraint
- Returns:
- the source information
-
getLevel
@NonNull public IConstraint.Level getLevel()
Description copied from interface:IConstraint
The significance of a violation of this constraint.- Specified by:
getLevel
in interfaceIConstraint
- Returns:
- the level
-
getTarget
public MetapathExpression getTarget()
Description copied from interface:IConstraint
Retrieve the Metapath expression to use to query the targets of the constraint.- Specified by:
getTarget
in interfaceIConstraint
- Returns:
- a Metapath expression
-
getProperties
public Map<QName,Set<String>> getProperties()
- Specified by:
getProperties
in interfaceIConstraint
-
getRemarks
public MarkupMultiline getRemarks()
Description copied from interface:IConstraint
Retrieve the remarks associated with the constraint.- Specified by:
getRemarks
in interfaceIConstraint
- Returns:
- the remarks or
null
if no remarks are defined
-
-