001/*
002 * SPDX-FileCopyrightText: none
003 * SPDX-License-Identifier: CC0-1.0
004 */
005
006package gov.nist.secauto.metaschema.databind.io;
007
008import gov.nist.secauto.metaschema.core.model.IBoundObject;
009import gov.nist.secauto.metaschema.databind.model.IBoundDefinitionModelComplex;
010import gov.nist.secauto.metaschema.databind.model.IBoundProperty;
011
012import java.io.IOException;
013import java.util.Collection;
014
015import edu.umd.cs.findbugs.annotations.NonNull;
016
017// TODO: consider what methods can be defined here
018public interface IProblemHandler {
019  /**
020   * A callback used to handle bound properties for which no data was found when
021   * the content was parsed.
022   * <p>
023   * This can be used to supply default or prescribed values based on application
024   * logic.
025   *
026   * @param parentDefinition
027   *          the bound class on which the missing properties are found
028   * @param targetObject
029   *          the Java object for the {@code parentDefinition}
030   * @param unhandledInstances
031   *          the set of instances that had no data to parse
032   * @throws IOException
033   *           if an error occurred while handling the missing instances
034   */
035  void handleMissingInstances(
036      @NonNull IBoundDefinitionModelComplex parentDefinition,
037      @NonNull IBoundObject targetObject,
038      @NonNull Collection<? extends IBoundProperty<?>> unhandledInstances)
039      throws IOException;
040}