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 whatFormatthe data is represented as.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFormatDetector.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.protectedFormatDetector(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.Resultdetect(InputStream inputStream)Analyzes the data from the providedinputStreamto determine it's format.FormatDetector.Resultdetect(URL resource)Analyzes the providedresourceto 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 providedresourceto 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 providedinputStreamto 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
-
-