public final class SpenTextRecognitionManager extends SpenRecognitionManager
| Modifier and Type | Field and Description |
|---|---|
static String |
SPEN_TEXT
The full class name of the preloaded TextRecognitionPlugin.
|
| Constructor and Description |
|---|
SpenTextRecognitionManager(Context context)
Creates an SpenTextRecognitionManager instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes an SpenTextRecognitionManager instance.
|
SpenTextRecognition |
createRecognition(SpenRecognitionInfo info)
Create an SpenTextRecognition instance with the specified recognition information from the candidate information
list.
You can get the information by calling getInfoList(int, int). |
SpenTextRecognition |
createRecognition(SpenRecognitionInfo info,
String key)
Create an SpenTextRecognition instance with the specified recognition information from the candidate information
list and the specified key.
You can get the information by calling getInfoList(int, int) |
SpenTextRecognition |
createRecognition(String className)
Create an SpenTextRecognition instance with the specified full class name.
If you know the name of the package and class, you can call this method directly without making a candidate list. |
SpenTextRecognition |
createRecognition(String className,
String key)
Create an SpenTextRecognition instance directly with the specified full class name and key.
If you already know the name of the package and class, you can call this method directly without make a candidate list. |
void |
destroyRecognition(SpenTextRecognition recognition)
Destroy the currently loaded text recognition instance.
|
List<SpenRecognitionInfo> |
getInfoList(int inputType,
int outputType)
Get the information list with the specified input type and output type.
The list includes all available TextRecognition Plug-ins with the given inputType and outputType
. |
String |
getPrivateKeyHint(SpenRecognitionInfo info)
Get a private key hint for the recognition plug-in.
|
public static final String SPEN_TEXT
public SpenTextRecognitionManager(Context context)
context - The Context for your application.IllegalArgumentException - Thrown when context is null.close()public List<SpenRecognitionInfo> getInfoList(int inputType, int outputType)
inputType and outputType
.inputType - The input object type for the recognition plug-in.outputType - The output object type of the recognition plug-in.SpenObjectBase.TYPE_NONE,
SpenObjectBase.TYPE_STROKE,
SpenObjectBase.TYPE_TEXT_BOX,
SpenObjectBase.TYPE_IMAGE,
SpenObjectBase.TYPE_CONTAINERpublic String getPrivateKeyHint(SpenRecognitionInfo info) throws ClassNotFoundException, InstantiationException, IllegalAccessException
info - The recognition information object.ClassNotFoundException - Thrown when the class loader is unable to find the specified class.InstantiationException - Thrown when the constructor is not accessible during instantiation.IllegalAccessException - Thrown when the class methods are not accessible.IllegalArgumentException - Thrown when info is null.public SpenTextRecognition createRecognition(SpenRecognitionInfo info) throws ClassNotFoundException, SpenCreationFailureException, Exception
getInfoList(int, int).info - The recognition information object.IllegalArgumentException - Thrown when the information passed is null.ClassNotFoundException - Thrown when the class loader is unable to find the specified classSpenCreationFailureException - Thrown when the recognition instance cannot be created.Exception - Thrown if the recognition engine returns an error.destroyRecognition(SpenTextRecognition)public SpenTextRecognition createRecognition(SpenRecognitionInfo info, String key) throws ClassNotFoundException, SpenCreationFailureException, Exception
getInfoList(int, int)info - The recognition information object.key - The private key for the recognition instance.IllegalArgumentException - Thrown when the information passed is null.ClassNotFoundException - Thrown when the class loader is unable to find the specified class.SpenCreationFailureException - Thrown when the recognition instance cannot be created.Exception - Thrown if the recognition engine returns an error.getPrivateKeyHint(SpenRecognitionInfo),
destroyRecognition(SpenTextRecognition)public SpenTextRecognition createRecognition(String className) throws ClassNotFoundException, SpenCreationFailureException, Exception
className - The full class name of the recognition plug-in.IllegalArgumentException - Thrown when the className passed is null.ClassNotFoundException - Thrown when the class loader is unable to find the specified class.SpenCreationFailureException - Thrown when the recognition instance cannot be created.Exception - Thrown if the recognition engine returns an error.destroyRecognition(SpenTextRecognition)public SpenTextRecognition createRecognition(String className, String key) throws ClassNotFoundException, SpenCreationFailureException, Exception
className - The full class name of the recognition plug-in.key - The private key for the recognition plug-in.IllegalArgumentException - Thrown when the className passed is null.ClassNotFoundException - Thrown when the class loader is unable to find the specified class.SpenCreationFailureException - Thrown when the recognition instance cannot be created.Exception - Thrown if the recognition engine returns an error.getPrivateKeyHint(SpenRecognitionInfo),
destroyRecognition(SpenTextRecognition)public void destroyRecognition(SpenTextRecognition recognition)
recognition - The SpenTextRecognition instance to destroy.IllegalArgumentException - Thrown when the recognition plug-in passed is not a loaded plug-in.createRecognition(SpenRecognitionInfo),
createRecognition(SpenRecognitionInfo, String),
createRecognition(String),
createRecognition(String, String)public void close()