Module dev.metaschema.databind
Package dev.metaschema.databind.model
Interface IBoundInstanceModel<ITEM>
- Type Parameters:
ITEM- the Java type for associated bound objects
- All Superinterfaces:
IBoundInstance<ITEM>,IBoundModelElement,IBoundModelObject<ITEM>,IBoundProperty<ITEM>,IDefaultable,IFeatureJavaField,IGroupable,IInstance,IInstanceAbsolute,IItemValueHandler<ITEM>,IJsonNamed,IModelElement,IModelElementVisitable,IModelInstance,IModelInstanceAbsolute,IValued,IValuedMutable
- All Known Subinterfaces:
IBoundInstanceModelAssembly,IBoundInstanceModelChoiceGroup,IBoundInstanceModelField<ITEM>,IBoundInstanceModelFieldComplex,IBoundInstanceModelFieldScalar,IBoundInstanceModelNamed<ITEM>
Represents an assembly or field instance bound to Java data.
-
Field Summary
Fields 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 TypeMethodDescriptiondefault voiddeepCopy(IBoundObject fromInstance, IBoundObject toInstance) Copy this instance from one parent object to another.Get the Java binding information for the collection type supported by this instance.Retrieve the Metaschema module definition on which the instance was declared.getItemJsonKey(Object item) Get the JSON key flag for the provided item.static Class<?>getItemType(Field field) Get the collection Java item type for the Java field associated with this instance.static <TYPE> Class<? extends TYPE>getItemType(Field field, Class<TYPE> expectedItemType) Get the collection Java item type for the Java field associated with this instance.default Collection<? extends Object>getItemValues(Object value) Get the item values associated with the provided value.default ObjectGet the actual default value to use for the model construct.Methods inherited from interface dev.metaschema.databind.model.IBoundInstance
getContainingModule, getValue, setValueMethods inherited from interface dev.metaschema.databind.model.IBoundModelObject
canHandleXmlQNameMethods inherited from interface dev.metaschema.core.model.IDefaultable
getDefaultValue, getEffectiveDefaultValueMethods inherited from interface dev.metaschema.databind.model.IFeatureJavaField
getField, getItemType, getTypeMethods inherited from interface dev.metaschema.core.model.IGroupable
getEffectiveXmlGroupAsQName, getGroupAsName, getJsonGroupAsBehavior, getMaxOccurs, getMinOccurs, getXmlGroupAsBehaviorMethods inherited from interface dev.metaschema.core.model.IInstance
toCoordinatesMethods inherited from interface dev.metaschema.databind.model.info.IItemValueHandler
deepCopyItem, readItem, writeItemMethods inherited from interface dev.metaschema.core.model.IJsonNamed
getJsonNameMethods inherited from interface dev.metaschema.core.model.IModelElement
getModelType, getRemarksMethods inherited from interface dev.metaschema.core.model.IModelElementVisitable
acceptMethods inherited from interface dev.metaschema.core.model.IModelInstance
getParentContainer, isEffectiveValueWrappedInXml
-
Method Details
-
getItemType
Get the collection Java item type for the Java field associated with this instance.- Parameters:
field- the Java field for the instance- Returns:
- the Java item type
-
getItemType
@NonNull static <TYPE> Class<? extends TYPE> getItemType(@NonNull Field field, @NonNull Class<TYPE> expectedItemType) Get the collection Java item type for the Java field associated with this instance.- Type Parameters:
TYPE- the item's expected Java type- Parameters:
field- the Java field for the instanceexpectedItemType- the item's expected Java type, which may be a super type of the item's type- Returns:
- the Java item type
-
getContainingDefinition
Description copied from interface:IInstanceRetrieve the Metaschema module definition on which the instance was declared.- Specified by:
getContainingDefinitionin interfaceIBoundInstance<ITEM>- Specified by:
getContainingDefinitionin interfaceIInstance- Specified by:
getContainingDefinitionin interfaceIModelInstance- Returns:
- the Metaschema module definition on which the instance was declared
-
getResolvedDefaultValue
Description copied from interface:IDefaultableGet the actual default value to use for the model construct.This will consider the effective default value in the use context to determine the appropriate default to use. Factors such as the required instance cardinality may affect if the effective default or an empty collection is used.
- Specified by:
getResolvedDefaultValuein interfaceIDefaultable- Returns:
- the actual default value or
nullif there is no actual default value
-
getItemValues
Get the item values associated with the provided value.- Specified by:
getItemValuesin interfaceIGroupable- Parameters:
value- the value which may be a singleton or a collection- Returns:
- the ordered collection of values
-
getCollectionInfo
Get the Java binding information for the collection type supported by this instance.- Returns:
- the collection Java binding information
-
getItemJsonKey
Get the JSON key flag for the provided item.- Parameters:
item- the item to get the JSON key flag for- Returns:
- the JSON key flag
-
deepCopy
default void deepCopy(@NonNull IBoundObject fromInstance, @NonNull IBoundObject toInstance) throws BindingException Description copied from interface:IBoundPropertyCopy this instance from one parent object to another.- Specified by:
deepCopyin interfaceIBoundProperty<ITEM>- Parameters:
fromInstance- the object to copy fromtoInstance- the object to copy to- Throws:
BindingException- if an error occurred while processing the object bindings
-