Class ModelDetector.Result

java.lang.Object
dev.metaschema.databind.io.ModelDetector.Result
All Implemented Interfaces:
Closeable, AutoCloseable
Enclosing class:
ModelDetector

public static final class ModelDetector.Result extends Object implements Closeable
Describes the result of detecting which model a resource is described by.

The method getBoundClass() can be used to get class binding for the identified node in a Metaschema-based model.

The method getDataStream() can be used to get a stream to read the content used for detection. This will replay any content used for detection.

  • Method Details

    • getBoundClass

      @NonNull public Class<? extends IBoundObject> getBoundClass()
      Get the Java class representing the detected bound object.
      Returns:
      the Java class
    • getDataStream

      @NonNull @Owning public @Owning InputStream getDataStream()
      Get an InputStream that can be used to read the analyzed data from the start.

      The caller owns this stream and is responsible for closing it.

      Returns:
      the stream
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException