001/*
002 * SPDX-FileCopyrightText: none
003 * SPDX-License-Identifier: CC0-1.0
004 */
005
006package gov.nist.secauto.metaschema.databind.model.info;
007
008import gov.nist.secauto.metaschema.core.model.IBoundObject;
009import gov.nist.secauto.metaschema.databind.model.IBoundDefinitionModelAssembly;
010import gov.nist.secauto.metaschema.databind.model.IBoundDefinitionModelFieldComplex;
011import gov.nist.secauto.metaschema.databind.model.IBoundFieldValue;
012import gov.nist.secauto.metaschema.databind.model.IBoundInstanceFlag;
013import gov.nist.secauto.metaschema.databind.model.IBoundInstanceModelAssembly;
014import gov.nist.secauto.metaschema.databind.model.IBoundInstanceModelChoiceGroup;
015import gov.nist.secauto.metaschema.databind.model.IBoundInstanceModelFieldComplex;
016import gov.nist.secauto.metaschema.databind.model.IBoundInstanceModelFieldScalar;
017import gov.nist.secauto.metaschema.databind.model.IBoundInstanceModelGroupedAssembly;
018import gov.nist.secauto.metaschema.databind.model.IBoundInstanceModelGroupedField;
019
020import java.io.IOException;
021
022import edu.umd.cs.findbugs.annotations.NonNull;
023
024public interface IItemWriteHandler {
025  /**
026   * Write an item.
027   *
028   * @param item
029   *          the Java object representing the item to write
030   * @param instance
031   *          the flag instance
032   * @throws IOException
033   *           if an error occurred while parsing
034   */
035  void writeItemFlag(
036      @NonNull Object item,
037      @NonNull IBoundInstanceFlag instance) throws IOException;
038
039  /**
040   * Write an item.
041   *
042   * @param item
043   *          the Java object representing the item to write
044   * @param instance
045   *          the field instance
046   * @throws IOException
047   *           if an error occurred while parsing
048   */
049  void writeItemField(
050      @NonNull Object item,
051      @NonNull IBoundInstanceModelFieldScalar instance) throws IOException;
052
053  /**
054   * Write an item.
055   *
056   * @param item
057   *          the Java object representing the item to write
058   * @param instance
059   *          the field instance
060   * @throws IOException
061   *           if an error occurred while parsing
062   */
063  void writeItemField(
064      @NonNull IBoundObject item,
065      @NonNull IBoundInstanceModelFieldComplex instance) throws IOException;
066
067  /**
068   * Write an item.
069   *
070   * @param item
071   *          the Java object representing the item to write
072   * @param instance
073   *          the field instance
074   * @throws IOException
075   *           if an error occurred while parsing
076   */
077  void writeItemField(
078      @NonNull IBoundObject item,
079      @NonNull IBoundInstanceModelGroupedField instance) throws IOException;
080
081  /**
082   * Write an item.
083   *
084   * @param item
085   *          the Java object representing the item to write
086   * @param definition
087   *          the field instance
088   * @throws IOException
089   *           if an error occurred while parsing
090   */
091  void writeItemField(
092      @NonNull IBoundObject item,
093      @NonNull IBoundDefinitionModelFieldComplex definition) throws IOException;
094
095  /**
096   * Write an item.
097   *
098   * @param item
099   *          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}