Package com.myscript.iink
Class RecognitionAssetsBuilder
java.lang.Object
com.myscript.iink.RecognitionAssetsBuilder
- All Implemented Interfaces:
AutoCloseable
The RecognitionAssetsBuilder implements the tools to generate and save recognition assets.
- Since:
- 1.2.4
-
Method Summary
Modifier and TypeMethodDescriptionprotected final void
final void
close()
void
Compile data into a recognition asset.protected void
finalize()
final @Nullable String
Get the last compilation errors.final @Nullable String[]
Returns the set of recognition assets types that this recognition assets builder can handle.final @Nullable String
getSupportedSymbols
(@NotNull String resourcePath) Get the list of symbols supported by a resource.final boolean
isClosed()
Tells whether theclose()
method has been called.void
Save the previously compiled recognition asset.
-
Method Details
-
finalize
-
close
public final void close()- Specified by:
close
in interfaceAutoCloseable
-
isClosed
public final boolean isClosed()Tells whether theclose()
method has been called. Once an object is closed any method will throwIllegalStateException
.- Returns:
true
if this object is closed.
-
checkNotClosed
protected final void checkNotClosed() -
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
- whentype
is not supported.RuntimeException
-
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
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.
-