java.lang.Object
dev.metaschema.databind.io.FormatDetector
Provides a means to analyze content to determine what
Format the data
is represented as.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRepresents the result of format detection, providing access to the detected format and the data stream for further processing. -
Constructor Summary
ConstructorsModifierConstructorDescriptionConstruct a new format detector using the default configuration.FormatDetector(dev.metaschema.core.configuration.IConfiguration<DeserializationFeature<?>> configuration) Construct a new format detector using the providedconfiguration.protectedFormatDetector(dev.metaschema.core.configuration.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 providedinputStreamto determine it's format.Analyzes the providedresourceto determine it's format.
-
Constructor Details
-
FormatDetector
public FormatDetector()Construct a new format detector using the default configuration. -
FormatDetector
public FormatDetector(@NonNull dev.metaschema.core.configuration.IConfiguration<DeserializationFeature<?>> configuration) Construct a new format detector using the providedconfiguration.- Parameters:
configuration- the deserialization configuration to use for detection
-
FormatDetector
protected FormatDetector(@NonNull dev.metaschema.core.configuration.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 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
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
-