- All Superinterfaces:
IAttributable,IContainer,IDefaultable,IDefinition,IDescribable,IFeatureValueConstrained,IField,IJsonNamed,IModelDefinition,IModelElement,IModelElementVisitable,INamed,INamedModelElement,IValueConstrained,IValuedDefinition
- All Known Subinterfaces:
IBoundDefinitionModelField<ITEM>,IBoundDefinitionModelFieldComplex,IBoundInstanceModelFieldScalar
- All Known Implementing Classes:
AbstractGlobalFieldDefinition,AbstractInlineFieldDefinition
Represents a field definition in a Metaschema module.
A field is a structured data object that may have flags (attributes) and a simple typed value. Field definitions specify the allowed flags, value type, and JSON serialization behavior for field instances.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.metaschema.core.model.IAttributable
IAttributable.KeyNested classes/interfaces inherited from interface dev.metaschema.core.model.IDefinition
IDefinition.ModuleScope -
Field Summary
Fields inherited from interface dev.metaschema.core.model.IAttributable
DEFAULT_PROPERY_NAMESPACEFields inherited from interface dev.metaschema.core.model.IDefinition
DEFAULT_MODULE_SCOPE -
Method Summary
Modifier and TypeMethodDescriptiondefault <CONTEXT,RESULT>
RESULTaccept(IModelElementVisitor<CONTEXT, RESULT> visitor, CONTEXT context) A visitor callback.default StringRetrieves the configured static label to use as the value key, or the type specific name if a label is not configured.default ObjectgetFieldValue(Object item) Get the value of the field's value from the field item object.default IFieldInstanceIfIDefinition.isInline()istrue, return the instance the definition is inlined for.default ObjectRetrieves the key to use as the field name for this field's value in JSON.Retrieves the flag instance whose value will be used as the "value key".Retrieves the configured static label to use as the value key, or the type specific name if a label is not configured.default booleanCheck if a JSON value key flag is configured.default booleanisInline()Determine if the definition is defined inline, meaning the definition is declared where it is used.Methods inherited from interface dev.metaschema.core.model.IAttributable
getProperties, getPropertyValues, hasProperty, hasPropertyValueMethods inherited from interface dev.metaschema.core.model.IDefaultable
getDefaultValue, getEffectiveDefaultValue, getResolvedDefaultValueMethods inherited from interface dev.metaschema.core.model.IDefinition
getDefinitionQName, getLocation, getModuleScope, toCoordinatesMethods inherited from interface dev.metaschema.core.model.IDescribable
getDescription, getEffectiveDescription, getEffectiveFormalName, getFormalNameMethods inherited from interface dev.metaschema.core.model.constraint.IFeatureValueConstrained
addConstraint, addConstraint, addConstraint, addConstraint, addConstraint, addLetExpression, getAllowedValuesConstraints, getConstraints, getConstraintSupport, getExpectConstraints, getIndexHasKeyConstraints, getLetExpressions, getMatchesConstraints, getReportConstraintsMethods inherited from interface dev.metaschema.core.model.IField
getModelTypeMethods inherited from interface dev.metaschema.core.model.IModelDefinition
getFlagInstanceByName, getFlagInstances, getJsonKey, hasChildrenMethods inherited from interface dev.metaschema.core.model.IModelElement
getContainingModule, getRemarksMethods inherited from interface dev.metaschema.core.model.INamed
getEffectiveIndex, getEffectiveName, getIndex, getName, getQName, getUseIndex, getUseNameMethods inherited from interface dev.metaschema.core.model.INamedModelElement
getJsonNameMethods inherited from interface dev.metaschema.core.model.constraint.IValueConstrained
getSourceMethods inherited from interface dev.metaschema.core.model.IValuedDefinition
getJavaTypeAdapter
-
Method Details
-
isInline
default boolean isInline()Description copied from interface:IDefinitionDetermine if the definition is defined inline, meaning the definition is declared where it is used.If this method returns
false, thenIDefinition.getInlineInstance()must returnnull.- Specified by:
isInlinein interfaceIDefinition- Returns:
trueif the definition is declared inline orfalseif the definition is able to be globally referenced- See Also:
-
getInlineInstance
Description copied from interface:IDefinitionIfIDefinition.isInline()istrue, return the instance the definition is inlined for.If this method returns
null, thenIDefinition.getInlineInstance()must returnfalse.- Specified by:
getInlineInstancein interfaceIDefinition- Returns:
- the instance or
nullotherwise - See Also:
-
getJsonValueKey
Retrieves the key to use as the field name for this field's value in JSON.- Returns:
- a string or a FlagInstance value
-
hasJsonValueKeyFlagInstance
default boolean hasJsonValueKeyFlagInstance()Check if a JSON value key flag is configured.- Returns:
trueif a JSON value key flag is configured, orfalseotherwise
-
getJsonValueKeyFlagInstance
Retrieves the flag instance whose value will be used as the "value key".- Returns:
- the configured flag instance, or
nullif a flag is not configured as the "value key"
-
getJsonValueKeyName
Retrieves the configured static label to use as the value key, or the type specific name if a label is not configured.- Returns:
- the value key label
-
getEffectiveJsonValueKeyName
Retrieves the configured static label to use as the value key, or the type specific name if a label is not configured.- Returns:
- the value key label
-
getFieldValue
Get the value of the field's value from the field item object.- Parameters:
item- the field item- Returns:
- the field's value or
nullif it has no value
-
accept
default <CONTEXT,RESULT> RESULT accept(@NonNull IModelElementVisitor<CONTEXT, RESULT> visitor, CONTEXT context) A visitor callback.- Specified by:
acceptin interfaceIModelElementVisitable- Type Parameters:
CONTEXT- the type of the context parameterRESULT- the type of the visitor result- Parameters:
visitor- the calling visitorcontext- a parameter used to pass contextual information between visitors- Returns:
- the visitor result
-