Class MobileDataType
- java.lang.Object
-
- com.inductiveautomation.perspective.common.mobile.MobileDataType
-
public class MobileDataType extends java.lang.Object
A convenience class for collecting the different data type identifiers used by the mobile device, as well as the script handlers that are associated with the originating data source. These types consist of a subset of the client's MobileDataType.ts enum, and include only those types which are intended to be submitted to the gw and handled as session events.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACCELEROMETER_SCRIPT
static java.lang.String
ACCELEROMETER_TYPE
static java.lang.String
BARCODE_SCRIPT
static java.lang.String
BARCODE_TYPE
static java.lang.String
BLUETOOTH_SCRIPT
static java.lang.String
BLUETOOTH_TYPE
static java.lang.String
IMAGE_SCRIPT
static java.lang.String
IMAGE_TYPE
static java.lang.String
NFC_SCRIPT
static java.lang.String
NFC_TYPE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Set<MobileDataHelper>
handlers()
Provides a set of all the data handling method names used to deal with mobile data submissions.static java.util.Optional<MobileDataHelper>
helperForType(java.lang.String type)
Returns the MobileDataHelper for the given method name;static java.util.Optional<java.lang.String>
scriptNameForType(java.lang.String typeKey)
Get the name of the event script that executes when data of the specified type is being handled.static java.util.Optional<java.lang.String>
typeKeyForScriptName(java.lang.String handlerName)
Get the name of the event script that executes when data of the specified type is being handled.static java.util.Set<java.lang.String>
types()
Return the set of know Mobile data source type IDs.
-
-
-
Field Detail
-
ACCELEROMETER_TYPE
public static final java.lang.String ACCELEROMETER_TYPE
- See Also:
- Constant Field Values
-
BARCODE_TYPE
public static final java.lang.String BARCODE_TYPE
- See Also:
- Constant Field Values
-
BLUETOOTH_TYPE
public static final java.lang.String BLUETOOTH_TYPE
- See Also:
- Constant Field Values
-
NFC_TYPE
public static final java.lang.String NFC_TYPE
- See Also:
- Constant Field Values
-
IMAGE_TYPE
public static final java.lang.String IMAGE_TYPE
- See Also:
- Constant Field Values
-
BARCODE_SCRIPT
public static final java.lang.String BARCODE_SCRIPT
- See Also:
- Constant Field Values
-
BLUETOOTH_SCRIPT
public static final java.lang.String BLUETOOTH_SCRIPT
- See Also:
- Constant Field Values
-
ACCELEROMETER_SCRIPT
public static final java.lang.String ACCELEROMETER_SCRIPT
- See Also:
- Constant Field Values
-
NFC_SCRIPT
public static final java.lang.String NFC_SCRIPT
- See Also:
- Constant Field Values
-
IMAGE_SCRIPT
public static final java.lang.String IMAGE_SCRIPT
- See Also:
- Constant Field Values
-
-
Method Detail
-
typeKeyForScriptName
public static java.util.Optional<java.lang.String> typeKeyForScriptName(@Nonnull java.lang.String handlerName)
Get the name of the event script that executes when data of the specified type is being handled.- Parameters:
handlerName
- the name of the script handler that handles a specific data type- Returns:
- the mobile data type id for the given handler name, or null if matching script handler name not found
-
scriptNameForType
public static java.util.Optional<java.lang.String> scriptNameForType(@Nonnull java.lang.String typeKey)
Get the name of the event script that executes when data of the specified type is being handled.- Parameters:
typeKey
- one of the types defined by the native mobile application and typescript MobileDataType client side class- Returns:
- the script handler name or null if matching script handler name not found
-
types
public static java.util.Set<java.lang.String> types()
Return the set of know Mobile data source type IDs.
-
handlers
public static java.util.Set<MobileDataHelper> handlers()
Provides a set of all the data handling method names used to deal with mobile data submissions. For example "onBarcodeScan"
-
helperForType
public static java.util.Optional<MobileDataHelper> helperForType(java.lang.String type)
Returns the MobileDataHelper for the given method name;- Parameters:
type
- the mobile data type fetch the handler for, e.g 'native/ndef'
-
-