1   /*
2    * SPDX-FileCopyrightText: none
3    * SPDX-License-Identifier: CC0-1.0
4    */
5   
6   package gov.nist.secauto.metaschema.databind.io;
7   
8   import gov.nist.secauto.metaschema.core.model.IBoundObject;
9   import gov.nist.secauto.metaschema.databind.model.IBoundDefinitionModelComplex;
10  import gov.nist.secauto.metaschema.databind.model.IBoundProperty;
11  
12  import java.io.IOException;
13  import java.util.Collection;
14  
15  import edu.umd.cs.findbugs.annotations.NonNull;
16  
17  // TODO: consider what methods can be defined here
18  public interface IProblemHandler {
19    /**
20     * A callback used to handle bound properties for which no data was found when
21     * the content was parsed.
22     * <p>
23     * This can be used to supply default or prescribed values based on application
24     * logic.
25     *
26     * @param parentDefinition
27     *          the bound class on which the missing properties are found
28     * @param targetObject
29     *          the Java object for the {@code parentDefinition}
30     * @param unhandledInstances
31     *          the set of instances that had no data to parse
32     * @throws IOException
33     *           if an error occurred while handling the missing instances
34     */
35    void handleMissingInstances(
36        @NonNull IBoundDefinitionModelComplex parentDefinition,
37        @NonNull IBoundObject targetObject,
38        @NonNull Collection<? extends IBoundProperty<?>> unhandledInstances)
39        throws IOException;
40  }