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 IFlagInstancegetFlagInstanceByName(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.INamedModelInstancegetInlineInstance()IfIDefinition.isInline()istrue, return the instance the definition is inlined for.IFlagInstancegetJsonKeyFlagInstance()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.IFlagContainergetOwningDefinition()Retrieve the Metaschema definition containing this container.default booleanhasJsonKey()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 booleanisSimple()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:
getOwningDefinitionin interfaceIContainer- Returns:
- the containing Metaschema definition
-
getInlineInstance
INamedModelInstance getInlineInstance()
Description copied from interface:IDefinitionIfIDefinition.isInline()istrue, return the instance the definition is inlined for.- Specified by:
getInlineInstancein interfaceIDefinition- Returns:
- the instance or
nullotherwise
-
isSimple
default boolean isSimple()
Identifies if the field has flags or not, or if it has a complex structure (i.e, model).- Returns:
trueif 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
nullif 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 atrueresult fromIFlagInstance.isRequired(). TheIFlagInstancecan be retrieved usinggetJsonKeyFlagInstance().- Returns:
trueif the flag's value can be used as a property name, orfalseotherwise- 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
nullotherwise - See Also:
hasJsonKey()
-
-