Class FormatDetector
- java.lang.Object
-
- gov.nist.secauto.metaschema.databind.io.FormatDetector
-
public class FormatDetector extends Object
Provides a means to analyze content to determine whatFormat
the data is represented as.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FormatDetector.Result
-
Constructor Summary
Constructors Modifier Constructor Description FormatDetector()
Construct 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FormatDetector.Result
detect(InputStream inputStream)
Analyzes the data from the providedinputStream
to determine it's format.FormatDetector.Result
detect(URL resource)
Analyzes the providedresource
to determine it's format.
-
-
-
Constructor Detail
-
FormatDetector
public FormatDetector()
Construct a new format detector using the default configuration.
-
FormatDetector
public FormatDetector(@NonNull IConfiguration<DeserializationFeature<?>> configuration)
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 Detail
-
detect
@NonNull public FormatDetector.Result detect(@NonNull URL resource) throws IOException
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
@NonNull public FormatDetector.Result detect(@NonNull InputStream inputStream) throws IOException
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
-
-