1   /*
2    * SPDX-FileCopyrightText: none
3    * SPDX-License-Identifier: CC0-1.0
4    */
5   
6   package gov.nist.secauto.metaschema.databind.model.info;
7   
8   import gov.nist.secauto.metaschema.core.model.IBoundObject;
9   import gov.nist.secauto.metaschema.databind.model.IBoundDefinitionModelAssembly;
10  import gov.nist.secauto.metaschema.databind.model.IBoundDefinitionModelFieldComplex;
11  import gov.nist.secauto.metaschema.databind.model.IBoundFieldValue;
12  import gov.nist.secauto.metaschema.databind.model.IBoundInstanceFlag;
13  import gov.nist.secauto.metaschema.databind.model.IBoundInstanceModelAssembly;
14  import gov.nist.secauto.metaschema.databind.model.IBoundInstanceModelChoiceGroup;
15  import gov.nist.secauto.metaschema.databind.model.IBoundInstanceModelFieldComplex;
16  import gov.nist.secauto.metaschema.databind.model.IBoundInstanceModelFieldScalar;
17  import gov.nist.secauto.metaschema.databind.model.IBoundInstanceModelGroupedAssembly;
18  import gov.nist.secauto.metaschema.databind.model.IBoundInstanceModelGroupedField;
19  
20  import java.io.IOException;
21  
22  import edu.umd.cs.findbugs.annotations.NonNull;
23  
24  public interface IItemWriteHandler {
25    /**
26     * Write an item.
27     *
28     * @param item
29     *          the Java object representing the item to write
30     * @param instance
31     *          the flag instance
32     * @throws IOException
33     *           if an error occurred while parsing
34     */
35    void writeItemFlag(
36        @NonNull Object item,
37        @NonNull IBoundInstanceFlag instance) throws IOException;
38  
39    /**
40     * Write an item.
41     *
42     * @param item
43     *          the Java object representing the item to write
44     * @param instance
45     *          the field instance
46     * @throws IOException
47     *           if an error occurred while parsing
48     */
49    void writeItemField(
50        @NonNull Object item,
51        @NonNull IBoundInstanceModelFieldScalar instance) throws IOException;
52  
53    /**
54     * Write an item.
55     *
56     * @param item
57     *          the Java object representing the item to write
58     * @param instance
59     *          the field instance
60     * @throws IOException
61     *           if an error occurred while parsing
62     */
63    void writeItemField(
64        @NonNull IBoundObject item,
65        @NonNull IBoundInstanceModelFieldComplex instance) throws IOException;
66  
67    /**
68     * Write an item.
69     *
70     * @param item
71     *          the Java object representing the item to write
72     * @param instance
73     *          the field instance
74     * @throws IOException
75     *           if an error occurred while parsing
76     */
77    void writeItemField(
78        @NonNull IBoundObject item,
79        @NonNull IBoundInstanceModelGroupedField instance) throws IOException;
80  
81    /**
82     * Write an item.
83     *
84     * @param item
85     *          the Java object representing the item to write
86     * @param definition
87     *          the field instance
88     * @throws IOException
89     *           if an error occurred while parsing
90     */
91    void writeItemField(
92        @NonNull IBoundObject item,
93        @NonNull IBoundDefinitionModelFieldComplex definition) throws IOException;
94  
95    /**
96     * Write an item.
97     *
98     * @param item
99     *          the Java object representing the item to write
100    * @param fieldValue
101    *          the field value instance
102    * @throws IOException
103    *           if an error occurred while parsing
104    */
105   void writeItemFieldValue(
106       @NonNull Object item,
107       @NonNull IBoundFieldValue fieldValue) throws IOException;
108 
109   /**
110    * Write an item.
111    *
112    * @param item
113    *          the Java object representing the item to write
114    * @param instance
115    *          the assembly instance
116    * @throws IOException
117    *           if an error occurred while parsing
118    */
119   void writeItemAssembly(
120       @NonNull IBoundObject item,
121       @NonNull IBoundInstanceModelAssembly instance) throws IOException;
122 
123   /**
124    * Write an item.
125    *
126    * @param item
127    *          the Java object representing the item to write
128    * @param instance
129    *          the assembly instance
130    * @throws IOException
131    *           if an error occurred while parsing
132    */
133   void writeItemAssembly(
134       @NonNull IBoundObject item,
135       @NonNull IBoundInstanceModelGroupedAssembly instance) throws IOException;
136 
137   /**
138    * Write an item.
139    *
140    * @param item
141    *          the Java object representing the item to write
142    * @param definition
143    *          the assembly instance
144    * @throws IOException
145    *           if an error occurred while parsing
146    */
147   void writeItemAssembly(
148       @NonNull IBoundObject item,
149       @NonNull IBoundDefinitionModelAssembly definition) throws IOException;
150 
151   /**
152    * Write an item.
153    *
154    * @param item
155    *          the Java object representing the item to write
156    * @param instance
157    *          the choice group instance
158    * @throws IOException
159    *           if an error occurred while parsing
160    */
161   void writeChoiceGroupItem(
162       @NonNull IBoundObject item,
163       @NonNull IBoundInstanceModelChoiceGroup instance) throws IOException;
164 
165 }