Class MetaschemaJsonReader
java.lang.Object
gov.nist.secauto.metaschema.databind.io.json.MetaschemaJsonReader
- All Implemented Interfaces:
- IParsingContext<com.fasterxml.jackson.core.JsonParser,,- IJsonProblemHandler> - IJsonParsingContext,- IItemReadHandler
Supports reading JSON-based Metaschema module instances.
- 
Nested Class SummaryNested classes/interfaces inherited from interface gov.nist.secauto.metaschema.databind.io.json.IJsonParsingContextIJsonParsingContext.IInstanceReader
- 
Constructor SummaryConstructorsConstructorDescriptionMetaschemaJsonReader(com.fasterxml.jackson.core.JsonParser parser, URI source) Construct a new Module-aware JSON parser using the default problem handler.MetaschemaJsonReader(com.fasterxml.jackson.core.JsonParser parser, URI source, IJsonProblemHandler problemHandler) Construct a new Module-aware JSON parser.
- 
Method SummaryModifier and TypeMethodDescriptionA handler that provides callbacks used to resolve parsing issues.com.fasterxml.jackson.core.JsonParserThe parser used for reading data associated with the supported format.Get the URI-based resource read by this parser.readChoiceGroupItem(IBoundObject parentItem, IBoundInstanceModelChoiceGroup instance) Parse and return an item.readItemAssembly(IBoundObject parentItem, IBoundDefinitionModelAssembly definition) Parse and return an item.readItemAssembly(IBoundObject parentItem, IBoundInstanceModelAssembly instance) Parse and return an item.readItemAssembly(IBoundObject parentItem, IBoundInstanceModelGroupedAssembly instance) Parse and return an item.readItemField(IBoundObject parentItem, IBoundDefinitionModelFieldComplex definition) Parse and return an item.readItemField(IBoundObject parentItem, IBoundInstanceModelFieldComplex instance) Parse and return an item.readItemField(IBoundObject parentItem, IBoundInstanceModelFieldScalar instance) Parse and return an item.readItemField(IBoundObject parentItem, IBoundInstanceModelGroupedField instance) Parse and return an item.readItemFieldValue(IBoundObject parentItem, IBoundFieldValue fieldValue) Parse and return an item.readItemFlag(IBoundObject parentItem, IBoundInstanceFlag instance) Parse and return an item.<T> TreadObject(IBoundDefinitionModelComplex definition) Read a JSON object value based on the provided definition.<T> TreadObjectRoot(IBoundDefinitionModelComplex definition, String expectedFieldName) Read a JSON property based on the provided definition.
- 
Constructor Details- 
MetaschemaJsonReaderpublic MetaschemaJsonReader(@NonNull com.fasterxml.jackson.core.JsonParser parser, @NonNull URI source) throws IOException Construct a new Module-aware JSON parser using the default problem handler.- Parameters:
- parser- the JSON parser to parse with
- source- the resource being parsed
- Throws:
- IOException- if an error occurred while reading the JSON
- See Also:
 
- 
MetaschemaJsonReaderpublic MetaschemaJsonReader(@NonNull com.fasterxml.jackson.core.JsonParser parser, @NonNull URI source, @NonNull IJsonProblemHandler problemHandler) throws IOException Construct a new Module-aware JSON parser.- Parameters:
- parser- the JSON parser to parse with
- source- the resource being parsed
- problemHandler- the problem handler implementation to use
- Throws:
- IOException- if an error occurred while reading the JSON
 
 
- 
- 
Method Details- 
getReaderDescription copied from interface:IParsingContextThe parser used for reading data associated with the supported format.- Specified by:
- getReaderin interface- IParsingContext<com.fasterxml.jackson.core.JsonParser,- IJsonProblemHandler> 
- Returns:
- the parser
 
- 
getSourceDescription copied from interface:IParsingContextGet the URI-based resource read by this parser.- Specified by:
- getSourcein interface- IParsingContext<com.fasterxml.jackson.core.JsonParser,- IJsonProblemHandler> 
- Returns:
- the resource URI
 
- 
getProblemHandlerDescription copied from interface:IParsingContextA handler that provides callbacks used to resolve parsing issues.- Specified by:
- getProblemHandlerin interface- IParsingContext<com.fasterxml.jackson.core.JsonParser,- IJsonProblemHandler> 
- Returns:
- the configured handler
 
- 
readObject@NonNull public <T> T readObject(@NonNull IBoundDefinitionModelComplex definition) throws IOException Read a JSON object value based on the provided definition.- Type Parameters:
- T- the Java type of the bound object produced by this parser
- Parameters:
- definition- the Metaschema module definition that describes the node to parse
- Returns:
- the resulting parsed bound object
- Throws:
- IOException- if an error occurred while parsing the content
 
- 
readObjectRoot@NonNull public <T> T readObjectRoot(@NonNull IBoundDefinitionModelComplex definition, @NonNull String expectedFieldName) throws IOException Read a JSON property based on the provided definition.- Type Parameters:
- T- the Java type of the bound object produced by this parser
- Parameters:
- definition- the Metaschema module definition that describes the node to parse
- expectedFieldName- the name of the JSON field to parse
- Returns:
- the resulting parsed bound object
- Throws:
- IOException- if an error occurred while parsing the content
 
- 
readItemFlagDescription copied from interface:IItemReadHandlerParse and return an item.- Specified by:
- readItemFlagin interface- IItemReadHandler
- Parameters:
- parentItem- the parent Java object to use for serialization callbacks
- instance- the flag instance
- Returns:
- the Java object representing the parsed item
- Throws:
- IOException- if an error occurred while parsing
 
- 
readItemFieldpublic Object readItemField(IBoundObject parentItem, IBoundInstanceModelFieldScalar instance) throws IOException Description copied from interface:IItemReadHandlerParse and return an item.- Specified by:
- readItemFieldin interface- IItemReadHandler
- Parameters:
- parentItem- the parent Java object to use for serialization callbacks
- instance- the field instance
- Returns:
- the Java object representing the parsed item
- Throws:
- IOException- if an error occurred while parsing
 
- 
readItemFieldpublic IBoundObject readItemField(IBoundObject parentItem, IBoundInstanceModelFieldComplex instance) throws IOException Description copied from interface:IItemReadHandlerParse and return an item.- Specified by:
- readItemFieldin interface- IItemReadHandler
- Parameters:
- parentItem- the parent Java object to use for serialization callbacks
- instance- the field instance
- Returns:
- the Java object representing the parsed item
- Throws:
- IOException- if an error occurred while parsing
 
- 
readItemFieldpublic IBoundObject readItemField(IBoundObject parentItem, IBoundInstanceModelGroupedField instance) throws IOException Description copied from interface:IItemReadHandlerParse and return an item.- Specified by:
- readItemFieldin interface- IItemReadHandler
- Parameters:
- parentItem- the parent Java object to use for serialization callbacks
- instance- the field instance
- Returns:
- the Java object representing the parsed item
- Throws:
- IOException- if an error occurred while parsing
 
- 
readItemFieldpublic IBoundObject readItemField(IBoundObject parentItem, IBoundDefinitionModelFieldComplex definition) throws IOException Description copied from interface:IItemReadHandlerParse and return an item.- Specified by:
- readItemFieldin interface- IItemReadHandler
- Parameters:
- parentItem- the parent Java object to use for serialization callbacks, or- nullif there is no parent
- definition- the field instance
- Returns:
- the Java object representing the parsed item
- Throws:
- IOException- if an error occurred while parsing
 
- 
readItemFieldValuepublic Object readItemFieldValue(IBoundObject parentItem, IBoundFieldValue fieldValue) throws IOException Description copied from interface:IItemReadHandlerParse and return an item.- Specified by:
- readItemFieldValuein interface- IItemReadHandler
- Parameters:
- parentItem- the parent Java object to use for serialization callbacks
- fieldValue- the field value instance
- Returns:
- the Java object representing the parsed item
- Throws:
- IOException- if an error occurred while parsing
 
- 
readItemAssemblypublic IBoundObject readItemAssembly(IBoundObject parentItem, IBoundInstanceModelAssembly instance) throws IOException Description copied from interface:IItemReadHandlerParse and return an item.- Specified by:
- readItemAssemblyin interface- IItemReadHandler
- Parameters:
- parentItem- the parent Java object to use for serialization callbacks
- instance- the assembly instance
- Returns:
- the Java object representing the parsed item
- Throws:
- IOException- if an error occurred while parsing
 
- 
readItemAssemblypublic IBoundObject readItemAssembly(IBoundObject parentItem, IBoundInstanceModelGroupedAssembly instance) throws IOException Description copied from interface:IItemReadHandlerParse and return an item.- Specified by:
- readItemAssemblyin interface- IItemReadHandler
- Parameters:
- parentItem- the parent Java object to use for serialization callbacks
- instance- the assembly instance
- Returns:
- the Java object representing the parsed item
- Throws:
- IOException- if an error occurred while parsing
 
- 
readItemAssemblypublic IBoundObject readItemAssembly(IBoundObject parentItem, IBoundDefinitionModelAssembly definition) throws IOException Description copied from interface:IItemReadHandlerParse and return an item.- Specified by:
- readItemAssemblyin interface- IItemReadHandler
- Parameters:
- parentItem- the parent Java object to use for serialization callbacks, or- nullif there is no parent
- definition- the assembly instance
- Returns:
- the Java object representing the parsed item
- Throws:
- IOException- if an error occurred while parsing
 
- 
readChoiceGroupItempublic IBoundObject readChoiceGroupItem(IBoundObject parentItem, IBoundInstanceModelChoiceGroup instance) throws IOException Description copied from interface:IItemReadHandlerParse and return an item.- Specified by:
- readChoiceGroupItemin interface- IItemReadHandler
- Parameters:
- parentItem- the parent Java object to use for serialization callbacks
- instance- the choice group instance
- Returns:
- the Java object representing the parsed item
- Throws:
- IOException- if an error occurred while parsing
 
 
-