Class ModelDetector
java.lang.Object
gov.nist.secauto.metaschema.databind.io.ModelDetector
Provides a means to analyze content to determine what type of bound data it
contains.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionModelDetector
(IBindingContext bindingContext) Construct a new format detector using the default configuration.ModelDetector
(IBindingContext bindingContext, IConfiguration<DeserializationFeature<?>> configuration) Construct a new format detector using the providedconfiguration
. -
Method Summary
Modifier and TypeMethodDescription@Owning ModelDetector.Result
detect
(InputStream inputStream, Format format) Analyzes the data from the providedinputStream
to determine it's model.
-
Constructor Details
-
ModelDetector
Construct a new format detector using the default configuration.- Parameters:
bindingContext
- information about how Java classes are bound to Module definitions
-
ModelDetector
public ModelDetector(@NonNull IBindingContext bindingContext, @NonNull IConfiguration<DeserializationFeature<?>> configuration) Construct a new format detector using the providedconfiguration
.- Parameters:
bindingContext
- information about how Java classes are bound to Module definitionsconfiguration
- the deserialization configuration
-
-
Method Details
-
detect
@NonNull @Owning public @Owning ModelDetector.Result detect(@NonNull @NotOwning InputStream inputStream, @NonNull Format format) throws IOException Analyzes the data from the providedinputStream
to determine it's model.- Parameters:
inputStream
- the resource stream to analyzeformat
- the expected format of the data to read- Returns:
- the analysis result
- Throws:
IOException
- if an error occurred while reading the resource
-