Class MetaschemaJsonWriter
java.lang.Object
gov.nist.secauto.metaschema.databind.io.json.MetaschemaJsonWriter
- All Implemented Interfaces:
IWritingContext<com.fasterxml.jackson.core.JsonGenerator>,IJsonWritingContext,IItemWriteHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface gov.nist.secauto.metaschema.databind.io.IWritingContext
IWritingContext.ObjectWriter<T extends IFeatureComplexItemValueHandler> -
Constructor Summary
ConstructorsConstructorDescriptionMetaschemaJsonWriter(com.fasterxml.jackson.core.JsonGenerator generator) Construct a new Module-aware JSON writer. -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.core.JsonGeneratorGet the writer associated with the writing context.voidwrite(IBoundDefinitionModelComplex definition, IBoundObject item) Write the data described by the providedtargetObjectas an XML element.voidwriteChoiceGroupItem(IBoundObject item, IBoundInstanceModelChoiceGroup instance) Write an item.voidwriteItemAssembly(IBoundObject item, IBoundDefinitionModelAssembly definition) Write an item.voidwriteItemAssembly(IBoundObject item, IBoundInstanceModelAssembly instance) Write an item.voidwriteItemAssembly(IBoundObject item, IBoundInstanceModelGroupedAssembly instance) Write an item.voidwriteItemField(IBoundObject item, IBoundDefinitionModelFieldComplex definition) Write an item.voidwriteItemField(IBoundObject item, IBoundInstanceModelFieldComplex instance) Write an item.voidwriteItemField(IBoundObject item, IBoundInstanceModelGroupedField instance) Write an item.voidwriteItemField(Object item, IBoundInstanceModelFieldScalar instance) Write an item.voidwriteItemFieldValue(Object item, IBoundFieldValue fieldValue) Write an item.voidwriteItemFlag(Object item, IBoundInstanceFlag instance) Write an item.
-
Constructor Details
-
MetaschemaJsonWriter
Construct a new Module-aware JSON writer.- Parameters:
generator- the JSON generator to write with- See Also:
-
-
Method Details
-
getWriter
Description copied from interface:IWritingContextGet the writer associated with the writing context.- Specified by:
getWriterin interfaceIWritingContext<com.fasterxml.jackson.core.JsonGenerator>- Returns:
- the writer
-
write
public void write(@NonNull IBoundDefinitionModelComplex definition, @NonNull IBoundObject item) throws IOException Description copied from interface:IWritingContextWrite the data described by the providedtargetObjectas an XML element.- Specified by:
writein interfaceIWritingContext<com.fasterxml.jackson.core.JsonGenerator>- Parameters:
definition- the bound Module definition describing the data to writeitem- the Java object data to write- Throws:
IOException- if an error occurred while writing
-
writeItemFlag
Description copied from interface:IItemWriteHandlerWrite an item.- Specified by:
writeItemFlagin interfaceIItemWriteHandler- Parameters:
item- the Java object representing the item to writeinstance- the flag instance- Throws:
IOException- if an error occurred while parsing
-
writeItemField
Description copied from interface:IItemWriteHandlerWrite an item.- Specified by:
writeItemFieldin interfaceIItemWriteHandler- Parameters:
item- the Java object representing the item to writeinstance- the field instance- Throws:
IOException- if an error occurred while parsing
-
writeItemField
public void writeItemField(IBoundObject item, IBoundInstanceModelFieldComplex instance) throws IOException Description copied from interface:IItemWriteHandlerWrite an item.- Specified by:
writeItemFieldin interfaceIItemWriteHandler- Parameters:
item- the Java object representing the item to writeinstance- the field instance- Throws:
IOException- if an error occurred while parsing
-
writeItemField
public void writeItemField(IBoundObject item, IBoundInstanceModelGroupedField instance) throws IOException Description copied from interface:IItemWriteHandlerWrite an item.- Specified by:
writeItemFieldin interfaceIItemWriteHandler- Parameters:
item- the Java object representing the item to writeinstance- the field instance- Throws:
IOException- if an error occurred while parsing
-
writeItemField
public void writeItemField(IBoundObject item, IBoundDefinitionModelFieldComplex definition) throws IOException Description copied from interface:IItemWriteHandlerWrite an item.- Specified by:
writeItemFieldin interfaceIItemWriteHandler- Parameters:
item- the Java object representing the item to writedefinition- the field instance- Throws:
IOException- if an error occurred while parsing
-
writeItemFieldValue
Description copied from interface:IItemWriteHandlerWrite an item.- Specified by:
writeItemFieldValuein interfaceIItemWriteHandler- Parameters:
item- the Java object representing the item to writefieldValue- the field value instance- Throws:
IOException- if an error occurred while parsing
-
writeItemAssembly
public void writeItemAssembly(IBoundObject item, IBoundInstanceModelAssembly instance) throws IOException Description copied from interface:IItemWriteHandlerWrite an item.- Specified by:
writeItemAssemblyin interfaceIItemWriteHandler- Parameters:
item- the Java object representing the item to writeinstance- the assembly instance- Throws:
IOException- if an error occurred while parsing
-
writeItemAssembly
public void writeItemAssembly(IBoundObject item, IBoundInstanceModelGroupedAssembly instance) throws IOException Description copied from interface:IItemWriteHandlerWrite an item.- Specified by:
writeItemAssemblyin interfaceIItemWriteHandler- Parameters:
item- the Java object representing the item to writeinstance- the assembly instance- Throws:
IOException- if an error occurred while parsing
-
writeItemAssembly
public void writeItemAssembly(IBoundObject item, IBoundDefinitionModelAssembly definition) throws IOException Description copied from interface:IItemWriteHandlerWrite an item.- Specified by:
writeItemAssemblyin interfaceIItemWriteHandler- Parameters:
item- the Java object representing the item to writedefinition- the assembly instance- Throws:
IOException- if an error occurred while parsing
-
writeChoiceGroupItem
public void writeChoiceGroupItem(IBoundObject item, IBoundInstanceModelChoiceGroup instance) throws IOException Description copied from interface:IItemWriteHandlerWrite an item.- Specified by:
writeChoiceGroupItemin interfaceIItemWriteHandler- Parameters:
item- the Java object representing the item to writeinstance- the choice group instance- Throws:
IOException- if an error occurred while parsing
-