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>,dev.metaschema.core.model.IDefaultable,IFeatureJavaField,dev.metaschema.core.model.IGroupable,dev.metaschema.core.model.IInstance,dev.metaschema.core.model.IInstanceAbsolute,IItemValueHandler<ITEM>,dev.metaschema.core.model.IJsonNamed,dev.metaschema.core.model.IModelElement,dev.metaschema.core.model.IModelElementVisitable,dev.metaschema.core.model.IModelInstance,dev.metaschema.core.model.IModelInstanceAbsolute,dev.metaschema.core.model.IValued,IValuedMutable
- All Known Subinterfaces:
IBoundInstanceModelAssembly,IBoundInstanceModelChoiceGroup,IBoundInstanceModelField<ITEM>,IBoundInstanceModelFieldComplex,IBoundInstanceModelFieldScalar,IBoundInstanceModelNamed<ITEM>
public interface IBoundInstanceModel<ITEM>
extends IBoundInstance<ITEM>, dev.metaschema.core.model.IModelInstanceAbsolute
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(dev.metaschema.core.model.IBoundObject fromInstance, dev.metaschema.core.model.IBoundObject toInstance) Copy this instance from one parent object to another.Get the Java binding information for the collection type supported by this instance.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 ObjectMethods 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
- Specified by:
getContainingDefinitionin interfaceIBoundInstance<ITEM>- Specified by:
getContainingDefinitionin interfacedev.metaschema.core.model.IInstance- Specified by:
getContainingDefinitionin interfacedev.metaschema.core.model.IModelInstance
-
getResolvedDefaultValue
- Specified by:
getResolvedDefaultValuein interfacedev.metaschema.core.model.IDefaultable
-
getItemValues
Get the item values associated with the provided value.- Specified by:
getItemValuesin interfacedev.metaschema.core.model.IGroupable- 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 dev.metaschema.core.model.IBoundObject fromInstance, @NonNull dev.metaschema.core.model.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
-