public class VisualFormatter
extends java.lang.Object
VisualFormatter is a class used to install and manage the different
projects created from the Visual Formatter tool available inside Scan2Deploy Studio.FORMATTER: Takes as input the barcode received from the scanner and transforms
it as desired, returning the modified barcode as output;DISPATCHER: Takes as input the barcode received from the scanner and selects
the FORMATTER items to execute.| Modifier and Type | Class and Description |
|---|---|
static class |
VisualFormatter.Item
VisualFormatter.Item is a class representing a visual formatting item,
used to manipulate the input barcode data when set as active item. |
static class |
VisualFormatter.PersistenceType
VisualFormatter.PersistenceType is an enumeration representing the
persistence type of the installed visual formatter configuration. |
| Modifier and Type | Method and Description |
|---|---|
VisualFormatter.Item |
getActiveItem()
Gets the currently active item if any, or null otherwise.
|
int |
getFeatureLevel()
Gets the Visual Formatter feature level.
|
static VisualFormatter |
getInstance()
Gets an instance of the VisualFormatter, if it is supported but the platform.
|
java.util.List<VisualFormatter.Item> |
getItems()
Lists all available formatting items.
|
int |
getTimeout()
Gets the Visual Formatter script execution timeout.
|
int |
install(java.lang.String path,
VisualFormatter.PersistenceType persistenceType,
boolean overwriteExisting)
Installs a new formatter project by specifying a zip file.
|
boolean |
isEnabled()
Checks if the Visual Formatter is enabled.
|
int |
remove(java.lang.String projectId)
Remove the items of the specified project.
|
int |
remove(VisualFormatter.PersistenceType persistenceType)
Remove the items of the specified persistence type.
|
int |
resetToDefault()
Removes all items that are reboot or enterprise reset persistent.
|
int |
setActiveItem(VisualFormatter.Item activeItem)
Sets the item to make active.
|
int |
setEnable(boolean enable)
Enables or disables the Visual Formatter.
|
int |
setTimeout(int timeout)
Sets the Visual Formatter script execution timeout.
|
public static VisualFormatter getInstance()
public boolean isEnabled()
DecodeException - in case of error, when exceptions are enabled through the ErrorManager singleton.public int setEnable(boolean enable)
enable - True to enable the Visual Formatter, false to disable it.DecodeException.SUCCESS in case it succeeds, otherwise it returns an error code if the
exceptions are disabled or throws a DecodeException in case the exceptions are enabled.DecodeException - in case of error, when exceptions are enabled through the ErrorManager singleton.public int getTimeout()
DecodeException - in case of error, when exceptions are enabled through the ErrorManager singleton.public int setTimeout(int timeout)
timeout - The timeout in milliseconds, with accepted values in range 10-1000.DecodeException.SUCCESS in case it succeeds, otherwise it returns an error code if the
exceptions are disabled or throws a DecodeException in case the exceptions are enabled.DecodeException - in case of error, when exceptions are enabled through the ErrorManager singleton.public int getFeatureLevel()
DecodeException - in case of error, when exceptions are enabled through the ErrorManager singleton.public int install(java.lang.String path,
VisualFormatter.PersistenceType persistenceType,
boolean overwriteExisting)
path - The path to a zip file containing the formatter project. The file can contain multitple scripts corresponding to
different formatting items.persistenceType - The type of persistence required for this formatter configuration. Can only be reboot or enterprise reset persistent.overwriteExisting - Used when some items with the same project ID of the new project are already installed in the device. It will clear all items found
with the same project ID of the new one before installing it.DecodeException - in case of error, when exceptions are enabled through the ErrorManager singleton.public int remove(java.lang.String projectId)
projectId - The project id.DecodeException - in case of error, when exceptions are enabled through the ErrorManager singleton.public int remove(VisualFormatter.PersistenceType persistenceType)
persistenceType - The persistence type of the items to remove.DecodeException - in case of error, when exceptions are enabled through the ErrorManager singleton.public int resetToDefault()
DecodeException.SUCCESS in case it succeeds, otherwise it returns an error code if the
exceptions are disabled or throws a DecodeException in case the exceptions are enabled.DecodeException - in case of error, when exceptions are enabled through the ErrorManager singleton.public VisualFormatter.Item getActiveItem()
DecodeException - in case of error, when exceptions are enabled through the ErrorManager singleton.public int setActiveItem(VisualFormatter.Item activeItem)
activeItem - The item to make active.DecodeException.SUCCESS in case it succeeds, otherwise it returns an error code if the
exceptions are disabled or throws a DecodeException in case the exceptions are enabled.DecodeException - in case of error, when exceptions are enabled through the ErrorManager singleton.public java.util.List<VisualFormatter.Item> getItems()
DecodeException - in case of error, when exceptions are enabled through the ErrorManager singleton.