Class FormatDetector
java.lang.Object
gov.nist.secauto.metaschema.databind.io.FormatDetector
Provides a means to analyze content to determine what
Format
the data
is represented as.-
Nested Class Summary
-
Constructor Summary
ModifierConstructorDescriptionConstruct a new format detector using the default configuration.FormatDetector
(IConfiguration<DeserializationFeature<?>> configuration) Construct a new format detector using the providedconfiguration
.protected
FormatDetector
(IConfiguration<DeserializationFeature<?>> configuration, com.fasterxml.jackson.core.JsonFactory... detectors) Construct a new format detector using the providedconfiguration
. -
Method Summary
Modifier and TypeMethodDescriptiondetect
(InputStream inputStream) Analyzes the data from the providedinputStream
to determine it's format.Analyzes the providedresource
to determine it's format.
-
Constructor Details
-
FormatDetector
public FormatDetector()Construct a new format detector using the default configuration. -
FormatDetector
Construct a new format detector using the providedconfiguration
.- Parameters:
configuration
- the deserialization configuration to use for detection
-
FormatDetector
protected FormatDetector(@NonNull IConfiguration<DeserializationFeature<?>> configuration, @NonNull com.fasterxml.jackson.core.JsonFactory... detectors) Construct a new format detector using the providedconfiguration
.- Parameters:
configuration
- the deserialization configuration to use for detectiondetectors
- the JSON parser instances to use for format detection
-
-
Method Details
-
detect
Analyzes the providedresource
to determine it's format.- Parameters:
resource
- the resource to analyze- Returns:
- the analysis result
- Throws:
IOException
- if an error occurred while reading the resource
-
detect
Analyzes the data from the providedinputStream
to determine it's format.- Parameters:
inputStream
- the resource stream to analyze- Returns:
- the analysis result
- Throws:
IOException
- if an error occurred while reading the resource
-