1   /*
2    * SPDX-FileCopyrightText: none
3    * SPDX-License-Identifier: CC0-1.0
4    */
5   
6   package gov.nist.secauto.metaschema.databind.io.json;
7   
8   import com.fasterxml.jackson.core.JsonParser;
9   
10  import gov.nist.secauto.metaschema.core.model.IBoundObject;
11  import gov.nist.secauto.metaschema.databind.io.IProblemHandler;
12  import gov.nist.secauto.metaschema.databind.model.IBoundDefinitionModelComplex;
13  
14  import java.io.IOException;
15  
16  import edu.umd.cs.findbugs.annotations.NonNull;
17  import edu.umd.cs.findbugs.annotations.Nullable;
18  
19  public interface IJsonProblemHandler extends IProblemHandler {
20  
21    /**
22     * Callback used to handle a JSON property that is unknown to the model being
23     * parsed.
24     *
25     * @param definition
26     *          the bound class currently describing the data being parsed
27     * @param parentItem
28     *          the Java object for the {@code parentDefinition}
29     * @param fieldName
30     *          the unknown JSON field name
31     * @param parser
32     *          the JSON reader context used for parsing
33     * @return {@code true} if the attribute was handled by this method, or
34     *         {@code false} otherwise
35     * @throws IOException
36     *           if an error occurred while handling the unrecognized data
37     */
38    boolean handleUnknownProperty(
39        @NonNull IBoundDefinitionModelComplex definition,
40        @Nullable IBoundObject parentItem,
41        @NonNull String fieldName,
42        @NonNull JsonParser parser) throws IOException;
43  }