public class Engine extends java.lang.Object implements IAutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
close()
Deletes native counterpart of this auto closable object
|
static Engine |
create(byte[] certificate)
Creates a new engine.
|
Editor |
createEditor(Renderer renderer)
Creates a new editor.
|
ContentPackage |
createPackage(java.io.File file)
Creates a new package.
|
ContentPackage |
createPackage(java.lang.String path)
Creates a new package.
|
ParameterSet |
createParameterSet()
Creates a new empty parameter set.
|
RecognitionAssetsBuilder |
createRecognitionAssetsBuilder()
Creates a new RecognitionAssetsBuilder.
|
Renderer |
createRenderer(float dpiX,
float dpiY,
IRenderTarget renderTarget)
Creates a new renderer.
|
void |
deletePackage(java.io.File file)
Deletes the specified package.
|
void |
deletePackage(java.lang.String path)
Deletes the specified package.
|
Configuration |
getConfiguration()
Returns the configuration associated with this engine.
|
java.lang.String[] |
getSupportedPartTypes()
Returns the set of content part types that this engine can handle.
|
boolean |
isClosed()
Tells whether the
close() method has been called. |
ContentPackage |
openPackage(java.io.File file)
Opens the specified package using the EXISTING package open option.
|
ContentPackage |
openPackage(java.io.File file,
PackageOpenOption openOption)
Opens the specified package.
|
ContentPackage |
openPackage(java.lang.String path)
Opens the specified package using the EXISTING package open option.
|
ContentPackage |
openPackage(java.lang.String path,
PackageOpenOption openOption)
Opens the specified package.
|
public static final Engine create(byte[] certificate) throws java.lang.IllegalArgumentException
Note: make sure to close the returned object.
certificate
- the certificate that identifies you as a valid MyScript
technology integrator.java.lang.IllegalArgumentException
- when the certificate is invalid.public final void close()
IAutoCloseable
close
in interface IAutoCloseable
public final boolean isClosed()
close()
method has been called. Once an object
is closed any method will throw IllegalStateException
.true
if this object is closed.public final Configuration getConfiguration()
Note: don't close the returned object as it is owned by the engine.
public final ContentPackage createPackage(java.io.File file) throws java.io.IOException
Note: make sure to close the returned object.
file
- the package file.java.io.IOException
- if a package with associated filename already exists.java.io.IOException
- if an I/O operation fails.java.lang.IllegalArgumentException
- if a package associated with the same filename
is already opened, it can be accessed via a call to openPackage().public final ContentPackage createPackage(java.lang.String path) throws java.io.IOException
Note: make sure to close the returned object.
path
- the package file path.java.io.IOException
- if a package with associated filename already exists.java.io.IOException
- if an I/O operation fails.java.lang.IllegalArgumentException
- if a package associated with the same filename
is already opened, it can be accessed via a call to openPackage().public final ContentPackage openPackage(java.io.File file) throws java.io.IOException
Note: make sure to close the returned object.
file
- the package file.java.io.IOException
- if a package with associated filename does not exist.java.io.IOException
- if an I/O operation fails.public final ContentPackage openPackage(java.io.File file, PackageOpenOption openOption) throws java.io.IOException
Note: make sure to close the returned object.
file
- the package file.openOption
- the open option used to open the package file.java.io.IOException
- when `openOption` is `EXISTING`, if a package with associated filename does not exist.java.io.IOException
- when `openOption` is `CREATE_NEW`, if a package with associated filename already exists.java.lang.IllegalArgumentException
- when `openOption` is `CREATE_NEW`, if a package associated with the same
filename is already opened.java.io.IOException
- if an I/O operation fails.public final ContentPackage openPackage(java.lang.String path) throws java.io.IOException
Note: make sure to close the returned object.
path
- the package file path.java.io.IOException
- if a package with associated filename does not exist.java.io.IOException
- if an I/O operation fails.public final ContentPackage openPackage(java.lang.String path, PackageOpenOption openOption) throws java.io.IOException
Note: make sure to close the returned object.
path
- the package file path.openOption
- the open option used to open the package file.java.io.IOException
- when `openOption` is `EXISTING`, if a package with associated filename does not exist.java.io.IOException
- when `openOption` is `CREATE_NEW`, if a package with associated filename already exists.java.lang.IllegalArgumentException
- when `openOption` is `CREATE_NEW`, if a package associated with the same
filename is already opened.java.io.IOException
- if an I/O operation fails.public final void deletePackage(java.io.File file) throws java.io.IOException, java.lang.IllegalArgumentException
file
- the package file.java.io.IOException
- if an I/O operation fails.java.lang.IllegalArgumentException
- when a package associated with the same
fileName is already opened.public final void deletePackage(java.lang.String path) throws java.io.IOException, java.lang.IllegalArgumentException
path
- the package file path.java.io.IOException
- if an I/O operation fails.java.lang.IllegalArgumentException
- when a package associated with the same
fileName is already opened.public final Renderer createRenderer(float dpiX, float dpiY, IRenderTarget renderTarget)
Note: make sure to close the returned object.
dpiX
- the physical horizontal resolution of the display in dots per
inch.dpiY
- the physical vertical resolution of the display in dots per
inch.renderTarget
- the render target.java.lang.IllegalArgumentException
- when dpiX
is not a number.java.lang.IllegalArgumentException
- when dpiX
is negative.java.lang.IllegalArgumentException
- when dpiY
is not a number.java.lang.IllegalArgumentException
- when dpiY
is negative.public final Editor createEditor(Renderer renderer)
renderer
- the renderer to be used to display editor's content.public final java.lang.String[] getSupportedPartTypes()
public final ParameterSet createParameterSet()
public final RecognitionAssetsBuilder createRecognitionAssetsBuilder()