1   /*
2    * SPDX-FileCopyrightText: none
3    * SPDX-License-Identifier: CC0-1.0
4    */
5   
6   package gov.nist.secauto.metaschema.databind.model;
7   
8   import gov.nist.secauto.metaschema.core.model.IBoundObject;
9   import gov.nist.secauto.metaschema.core.model.IInstance;
10  
11  import edu.umd.cs.findbugs.annotations.NonNull;
12  import edu.umd.cs.findbugs.annotations.Nullable;
13  
14  /**
15   * Represents a Metaschema module instance bound to Java data.
16   *
17   * @param <ITEM>
18   *          the Java type for associated bound objects
19   */
20  public interface IBoundInstance<ITEM> extends IBoundProperty<ITEM>, IBoundModelElement, IInstance {
21    @Override
22    IBoundDefinitionModel<IBoundObject> getContainingDefinition();
23  
24    @Override
25    default IBoundModule getContainingModule() {
26      return getContainingDefinition().getContainingModule();
27    }
28  
29    /**
30     * {@inheritDoc}
31     * <p>
32     * Always bound to a field.
33     */
34    @Override
35    @Nullable
36    default Object getValue(@NonNull Object parent) {
37      return IBoundProperty.super.getValue(parent);
38    }
39  
40    /**
41     * {@inheritDoc}
42     * <p>
43     * Always bound to a field.
44     */
45    @Override
46    default void setValue(@NonNull Object parentObject, @Nullable Object value) {
47      IBoundProperty.super.setValue(parentObject, value);
48    }
49  }