Class ModelDetector


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

      • 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 Detail

      • detect

        @NonNull
        public ModelDetector.Result detect​(@NonNull
                                           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