001/*
002 * SPDX-FileCopyrightText: none
003 * SPDX-License-Identifier: CC0-1.0
004 */
005
006package gov.nist.secauto.metaschema.databind.model;
007
008import gov.nist.secauto.metaschema.core.model.IBoundObject;
009import gov.nist.secauto.metaschema.core.model.IInstance;
010
011import edu.umd.cs.findbugs.annotations.NonNull;
012import edu.umd.cs.findbugs.annotations.Nullable;
013
014/**
015 * Represents a Metaschema module instance bound to Java data.
016 *
017 * @param <ITEM>
018 *          the Java type for associated bound objects
019 */
020public interface IBoundInstance<ITEM> extends IBoundProperty<ITEM>, IBoundModelElement, IInstance {
021  @Override
022  IBoundDefinitionModel<IBoundObject> getContainingDefinition();
023
024  @Override
025  default IBoundModule getContainingModule() {
026    return getContainingDefinition().getContainingModule();
027  }
028
029  /**
030   * {@inheritDoc}
031   * <p>
032   * Always bound to a field.
033   */
034  @Override
035  @Nullable
036  default Object getValue(@NonNull Object parent) {
037    return IBoundProperty.super.getValue(parent);
038  }
039
040  /**
041   * {@inheritDoc}
042   * <p>
043   * Always bound to a field.
044   */
045  @Override
046  default void setValue(@NonNull Object parentObject, @Nullable Object value) {
047    IBoundProperty.super.setValue(parentObject, value);
048  }
049}