Class RecognitionAssetsBuilder

java.lang.Object
com.myscript.iink.RecognitionAssetsBuilder
All Implemented Interfaces:
AutoCloseable

public class RecognitionAssetsBuilder extends Object implements AutoCloseable
The RecognitionAssetsBuilder implements the tools to generate and save recognition assets.
Since:
1.2.4
  • Method Details

    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
    • isClosed

      public final boolean isClosed()
      Tells whether the close() method has been called. Once an object is closed any method will throw IllegalStateException.
      Returns:
      true if this object is closed.
    • checkNotClosed

      protected final void checkNotClosed()
    • getSupportedRecognitionAssetsTypes

      @Nullable public final @Nullable String[] getSupportedRecognitionAssetsTypes()
      Returns the set of recognition assets types that this recognition assets builder can handle.
      Returns:
      an unmodifiable set of the supported recognition assets type names.
      Throws:
      IllegalStateException - when this recognition assets builder is closed.
    • getSupportedSymbols

      @Nullable public final @Nullable String getSupportedSymbols(@NotNull @NotNull String resourcePath) throws IllegalStateException, RuntimeException
      Get the list of symbols supported by a resource.
      Parameters:
      resourcePath - the path of the resource.
      Returns:
      the list of supported symbols.
      Throws:
      IllegalStateException - when this recognition assets builder is closed.
      RuntimeException - when the symbols could not be loaded from the resource.
      Since:
      3.0
    • compile

      public void compile(@NotNull @NotNull String type, @NotNull @NotNull String data) throws IllegalArgumentException, RuntimeException
      Compile data into a recognition asset.
      Parameters:
      type - the type of asset that will be generated.
      data - the data to compile.
      Throws:
      IllegalStateException - when this recognition assets builder is closed.
      IllegalStateException - when the content of data could not be compiled into a recognition asset.
      IllegalArgumentException - when type is not supported.
      RuntimeException
    • getCompilationErrors

      @Nullable public final @Nullable String getCompilationErrors()
      Get the last compilation errors.
      Returns:
      a description of the errors that occurred during the last compilation.
      Throws:
      IllegalStateException - when this recognition assets builder is closed.
    • store

      public void store(@NotNull @NotNull String path) throws IOException
      Save the previously compiled recognition asset.
      Parameters:
      path - the path to destination file.
      Throws:
      IllegalStateException - when this recognition assets builder is closed.
      IOException - when there is no valid recognition asset to store.
      IOException - if an I/O operation fails.