- All Superinterfaces:
IAttributable,IDefaultable,IDescribable,IGroupable,IInstance,IJsonNamed,IModelElement,IModelElementVisitable,IModelInstance,INamed,INamedInstance,INamedModelElement
- All Known Subinterfaces:
IAssemblyInstance,IAssemblyInstanceAbsolute,IAssemblyInstanceGrouped,IBoundInstanceModelAssembly,IBoundInstanceModelField<ITEM>,IBoundInstanceModelFieldComplex,IBoundInstanceModelFieldScalar,IBoundInstanceModelGroupedAssembly,IBoundInstanceModelGroupedField,IBoundInstanceModelGroupedNamed,IBoundInstanceModelNamed<ITEM>,IFieldInstance,IFieldInstanceAbsolute,IFieldInstanceGrouped,INamedModelInstanceAbsolute,INamedModelInstanceGrouped
- All Known Implementing Classes:
AbstractAssemblyInstance,AbstractFieldInstance,AbstractInlineAssemblyDefinition,AbstractInlineFieldDefinition,AbstractNamedModelInstance
Represents a named instance of a field or assembly within a model.
Provides access to the instance's definition and JSON key configuration for serialization purposes.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.metaschema.core.model.IAttributable
IAttributable.Key -
Field Summary
Fields inherited from interface dev.metaschema.core.model.IAttributable
DEFAULT_PROPERY_NAMESPACEFields inherited from interface dev.metaschema.core.model.IGroupable
DEFAULT_GROUP_AS_MAX_OCCURS, DEFAULT_GROUP_AS_MIN_OCCURS, DEFAULT_JSON_GROUP_AS_BEHAVIOR, DEFAULT_XML_GROUP_AS_BEHAVIOR -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancomplexObjectFilter(INamedModelInstance instance) Tests if the provided instance represents complex data.Retrieve the definition of this instance.Get the JSON key flag instance for this model instance, if one is configured.Get the JSON key associated with this instance.default booleanIndicates if a flag's value can be used as a property name in the containing object in JSON whose value will be the object containing the flag.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.IDescribable
getDescription, getEffectiveDescription, getEffectiveFormalName, getFormalNameMethods inherited from interface dev.metaschema.core.model.IGroupable
getEffectiveXmlGroupAsQName, getGroupAsName, getItemValues, getJsonGroupAsBehavior, getMaxOccurs, getMinOccurs, getXmlGroupAsBehaviorMethods inherited from interface dev.metaschema.core.model.IInstance
toCoordinatesMethods inherited from interface dev.metaschema.core.model.IModelElement
getContainingModule, getModelType, getRemarksMethods inherited from interface dev.metaschema.core.model.IModelElementVisitable
acceptMethods inherited from interface dev.metaschema.core.model.IModelInstance
getContainingDefinition, getParentContainer, isEffectiveValueWrappedInXmlMethods inherited from interface dev.metaschema.core.model.INamed
getEffectiveIndex, getEffectiveName, getIndex, getName, getQName, getUseIndex, getUseNameMethods inherited from interface dev.metaschema.core.model.INamedInstance
getReferencedDefinitionQName, isInlineDefinitionMethods inherited from interface dev.metaschema.core.model.INamedModelElement
getJsonName
-
Method Details
-
complexObjectFilter
Tests if the provided instance represents complex data. The data is complex if one of the following is true:- The instance is a
IAssemblyInstance. - The instance is a
IFieldInstancethat has flags.
Predicate.- Parameters:
instance- the instance to test- Returns:
trueif the data is complex, orfalseotherwise
- The instance is a
-
getDefinition
Description copied from interface:INamedInstanceRetrieve the definition of this instance.- Specified by:
getDefinitionin interfaceINamedInstance- Returns:
- the corresponding definition
-
hasJsonKey
default boolean hasJsonKey()Indicates if a flag's value can be used as a property name in the containing object in JSON whose 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 usinggetEffectiveJsonKey().- Returns:
trueif the flag's value can be used as a property name, orfalseotherwise- See Also:
-
getEffectiveJsonKey
Get the JSON key flag instance for this model instance, if one is configured.- Returns:
- the JSON key flag instance or
nullif no JSON key is configured
-
getJsonKey
Get the JSON key associated with this instance.- Returns:
- the configured JSON key or
nullif no JSON key is configured
-