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
ConstructorDescriptionMetaschemaJsonWriter
(com.fasterxml.jackson.core.JsonGenerator generator) Construct a new Module-aware JSON writer. -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.core.JsonGenerator
Get the writer associated with the writing context.void
write
(IBoundDefinitionModelComplex definition, IBoundObject item) Write the data described by the providedtargetObject
as an XML element.void
writeChoiceGroupItem
(IBoundObject item, IBoundInstanceModelChoiceGroup instance) Write an item.void
writeItemAssembly
(IBoundObject item, IBoundDefinitionModelAssembly definition) Write an item.void
writeItemAssembly
(IBoundObject item, IBoundInstanceModelAssembly instance) Write an item.void
writeItemAssembly
(IBoundObject item, IBoundInstanceModelGroupedAssembly instance) Write an item.void
writeItemField
(IBoundObject item, IBoundDefinitionModelFieldComplex definition) Write an item.void
writeItemField
(IBoundObject item, IBoundInstanceModelFieldComplex instance) Write an item.void
writeItemField
(IBoundObject item, IBoundInstanceModelGroupedField instance) Write an item.void
writeItemField
(Object item, IBoundInstanceModelFieldScalar instance) Write an item.void
writeItemFieldValue
(Object item, IBoundFieldValue fieldValue) Write an item.void
writeItemFlag
(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:IWritingContext
Get the writer associated with the writing context.- Specified by:
getWriter
in 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:IWritingContext
Write the data described by the providedtargetObject
as an XML element.- Specified by:
write
in 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:IItemWriteHandler
Write an item.- Specified by:
writeItemFlag
in 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:IItemWriteHandler
Write an item.- Specified by:
writeItemField
in 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:IItemWriteHandler
Write an item.- Specified by:
writeItemField
in 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:IItemWriteHandler
Write an item.- Specified by:
writeItemField
in 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:IItemWriteHandler
Write an item.- Specified by:
writeItemField
in 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:IItemWriteHandler
Write an item.- Specified by:
writeItemFieldValue
in 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:IItemWriteHandler
Write an item.- Specified by:
writeItemAssembly
in 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:IItemWriteHandler
Write an item.- Specified by:
writeItemAssembly
in 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:IItemWriteHandler
Write an item.- Specified by:
writeItemAssembly
in 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:IItemWriteHandler
Write an item.- Specified by:
writeChoiceGroupItem
in interfaceIItemWriteHandler
- Parameters:
item
- the Java object representing the item to writeinstance
- the choice group instance- Throws:
IOException
- if an error occurred while parsing
-