java.lang.Object
gov.nist.secauto.metaschema.databind.io.ModelDetector

public class ModelDetector extends Object
Provides a means to analyze content to determine what type of bound data it contains.
  • Constructor Details

    • ModelDetector

      public ModelDetector(@NonNull IBindingContext bindingContext)
      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 provided configuration.
      Parameters:
      bindingContext - information about how Java classes are bound to Module definitions
      configuration - 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 provided inputStream to determine it's model.
      Parameters:
      inputStream - the resource stream to analyze
      format - the expected format of the data to read
      Returns:
      the analysis result
      Throws:
      IOException - if an error occurred while reading the resource