Interface IFlagContainer
-
- All Superinterfaces:
IConstrained
,IContainer
,IDefinition
,gov.nist.secauto.metaschema.core.model.constraint.impl.IFeatureValueConstrained
,IModelElement
,INamedModelElement
,IValueConstrained
- All Known Subinterfaces:
IAssemblyDefinition
,IFeatureFlagContainer<F>
,IFieldDefinition
public interface IFlagContainer extends IDefinition, IContainer
This marker interface identifies a type of definition that contains flags, either a field or assembly.
-
-
Field Summary
-
Fields inherited from interface gov.nist.secauto.metaschema.core.model.IDefinition
DEFAULT_DEFINITION_MODEL_SCOPE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description IFlagInstance
getFlagInstanceByName(String name)
Retrieves a flag instance, by the flag's effective name, that is defined on the containing definition.Collection<? extends IFlagInstance>
getFlagInstances()
Retrieves the flag instances for all flags defined on the containing definition.INamedModelInstance
getInlineInstance()
IfIDefinition.isInline()
istrue
, return the instance the definition is inlined for.IFlagInstance
getJsonKeyFlagInstance()
Retrieves the flag instance to use as as the property name for the containing object in JSON who's value will be the object containing the flag.IFlagContainer
getOwningDefinition()
Retrieve the Metaschema definition containing this container.default boolean
hasJsonKey()
Indicates if a flag's value can be used as a property name in the containing object in JSON who's value will be the object containing the flag.default boolean
isSimple()
Identifies if the field has flags or not, or if it has a complex structure (i.e, model).-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.IDefinition
getModuleScope, isInline, toCoordinates
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.constraint.impl.IFeatureValueConstrained
addConstraint, addConstraint, addConstraint, addConstraint, getAllowedValuesConstraints, getConstraints, getConstraintSupport, getExpectConstraints, getIndexHasKeyConstraints, getMatchesConstraints
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.IModelElement
getContainingModule, getModelType, getRemarks
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.INamedModelElement
getDescription, getEffectiveDescription, getEffectiveFormalName, getEffectiveName, getFormalName, getJsonName, getName, getProperties, getPropertyValues, getUseName, hasProperty, hasPropertyValue
-
-
-
-
Method Detail
-
getOwningDefinition
@NonNull IFlagContainer getOwningDefinition()
Retrieve the Metaschema definition containing this container.- Specified by:
getOwningDefinition
in interfaceIContainer
- Returns:
- the containing Metaschema definition
-
getInlineInstance
INamedModelInstance getInlineInstance()
Description copied from interface:IDefinition
IfIDefinition.isInline()
istrue
, return the instance the definition is inlined for.- Specified by:
getInlineInstance
in interfaceIDefinition
- Returns:
- the instance or
null
otherwise
-
isSimple
default boolean isSimple()
Identifies if the field has flags or not, or if it has a complex structure (i.e, model).- Returns:
true
if the field has no flags or model, or false otherwise
-
getFlagInstanceByName
@Nullable IFlagInstance getFlagInstanceByName(@NonNull String name)
Retrieves a flag instance, by the flag's effective name, that is defined on the containing definition.- Parameters:
name
- the flag's name- Returns:
- the matching flag instance, or
null
if there is no flag matching the specified name
-
getFlagInstances
@NonNull Collection<? extends IFlagInstance> getFlagInstances()
Retrieves the flag instances for all flags defined on the containing definition.- Returns:
- the flags
-
hasJsonKey
default boolean hasJsonKey()
Indicates if a flag's value can be used as a property name in the containing object in JSON who's value will be the object containing the flag. In such cases, the flag will not appear in the object. This is only allowed if the flag is required, as determined by atrue
result fromIFlagInstance.isRequired()
. TheIFlagInstance
can be retrieved usinggetJsonKeyFlagInstance()
.- Returns:
true
if the flag's value can be used as a property name, orfalse
otherwise- See Also:
getJsonKeyFlagInstance()
-
getJsonKeyFlagInstance
@Nullable IFlagInstance getJsonKeyFlagInstance()
Retrieves the flag instance to use as as the property name for the containing object in JSON who's value will be the object containing the flag.- Returns:
- the flag instance if a JSON key is configured, or
null
otherwise - See Also:
hasJsonKey()
-
-