Class DefaultBindingParameter<T>
- java.lang.Object
- 
- com.inductiveautomation.vision.api.client.binding.DefaultBindingParameter<T>
 
- 
- All Implemented Interfaces:
- BindingParameter<T>
 
 public class DefaultBindingParameter<T> extends java.lang.Object implements BindingParameter<T> Default implementation of BindingParameter. Commonly a binding parameter will be a instance of this class or an anonymous subclass of this class to override various functions such asgetOptionMap().
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface com.inductiveautomation.vision.api.client.binding.BindingParameterBindingParameter.BrowseHelper
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected TdefaultValueprotected java.lang.StringparameterNameprotected java.lang.Class<T>parameterTypeprotected java.lang.StringtitleKey
 - 
Constructor SummaryConstructors Constructor Description DefaultBindingParameter(java.lang.String parameterName, java.lang.String titleKey, T defaultValue)DefaultBindingParameter(java.lang.String parameterName, java.lang.String titleKey, T defaultValue, java.lang.Class<T> parameterType)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Tcoerce(java.lang.String rawValue)Abstract implementation provides the following logic: If rawValue is null or blank, use the default value. else, useTypeUtilities.coerce(Object, Class)to coerce rawValue into Tprotected static java.util.List<StringPair>createBasicOptionMap(java.lang.String... options)Creates a basic option map out of a list of Stringsprotected static java.util.List<StringPair>createModuleRPCOptionMap(java.lang.String moduleId, java.lang.String function)Just likecreateRPCOptionMap(String), but uses module-based rpc instead.protected static java.util.List<StringPair>createNameBasedEnumOptions(java.lang.Class<? extends java.lang.Enum> enumClass, boolean includeNone)Creates an option map out of an enum, where the names of the enum are the intended value.protected static java.util.List<StringPair>createOrdinalBasedEnumOptions(java.lang.Class<? extends java.lang.Enum> enumClass, boolean includeNone)Creates an option map out of an enum, where the ordinals (or getIntValue's) of the enum are the intended value.protected static java.util.List<StringPair>createRPCOptionMap(java.lang.String rpcCall)Calls through to the gateway via RPC to the given function call.BindingParameter.BrowseHelpergetBrowseHelper()Default implementation returns null.TgetDefaultValue()Provide a default value to use for this parameter if the user left the parameter blankjava.util.List<StringPair>getOptionMap()Default implementation returns null.java.lang.StringgetParameterName()The name of this parameter.java.lang.Class<T>getParameterType()The data type of the parameter.java.lang.StringgetTitleKey()A resource bundle key to use as the param's title for display purposes.java.lang.StringgetTooltipKey()A resource bundle key to use for the GUI control's tooltipbooleanisBindingAllowed()If true, the user will be allowed to bind this parameter's runtime value to tags and/or properties
 
- 
- 
- 
Constructor Detail- 
DefaultBindingParameterpublic DefaultBindingParameter(java.lang.String parameterName, java.lang.String titleKey, T defaultValue)
 
- 
 - 
Method Detail- 
createOrdinalBasedEnumOptionsprotected static java.util.List<StringPair> createOrdinalBasedEnumOptions(java.lang.Class<? extends java.lang.Enum> enumClass, boolean includeNone) Creates an option map out of an enum, where the ordinals (or getIntValue's) of the enum are the intended value.- Parameters:
- includeNone- If true, a "None" option will be included whose value is empty string.
 
 - 
createNameBasedEnumOptionsprotected static java.util.List<StringPair> createNameBasedEnumOptions(java.lang.Class<? extends java.lang.Enum> enumClass, boolean includeNone) Creates an option map out of an enum, where the names of the enum are the intended value.- Parameters:
- includeNone- If true, a "None" option will be included whose value is empty string.
 
 - 
createBasicOptionMapprotected static java.util.List<StringPair> createBasicOptionMap(java.lang.String... options) Creates a basic option map out of a list of Strings
 - 
createRPCOptionMapprotected static java.util.List<StringPair> createRPCOptionMap(java.lang.String rpcCall) Calls through to the gateway via RPC to the given function call. It is assumed that this function call returns a list of strings. For example, the rpc call "Alert.getStorageProfiles" would be an appropriate call, because it returns a list of strings. See also:
 - 
createModuleRPCOptionMapprotected static java.util.List<StringPair> createModuleRPCOptionMap(java.lang.String moduleId, java.lang.String function) Just likecreateRPCOptionMap(String), but uses module-based rpc instead.
 - 
coercepublic T coerce(java.lang.String rawValue) throws java.lang.ClassCastException Abstract implementation provides the following logic:- If rawValue is null or blank, use the default value.
- else, use TypeUtilities.coerce(Object, Class)to coerce rawValue into T
 - Specified by:
- coercein interface- BindingParameter<T>
- Throws:
- java.lang.ClassCastException- If this is thrown, the binding will not be executed, instead the property will receive a poor data quality.
 
 - 
getDefaultValuepublic T getDefaultValue() Provide a default value to use for this parameter if the user left the parameter blank- Specified by:
- getDefaultValuein interface- BindingParameter<T>
 
 - 
getOptionMappublic java.util.List<StringPair> getOptionMap() Default implementation returns null. Meant to be overridden.- Specified by:
- getOptionMapin interface- BindingParameter<T>
 
 - 
getBrowseHelperpublic BindingParameter.BrowseHelper getBrowseHelper() Default implementation returns null. Meant to be overridden.- Specified by:
- getBrowseHelperin interface- BindingParameter<T>
 
 - 
getParameterTypepublic java.lang.Class<T> getParameterType() Description copied from interface:BindingParameterThe data type of the parameter. All parameters are treated as Strings during the design phase, but will be coerced to this type right before execution. Coersion is handled by theBindingParameter.coerce(String)function.- Specified by:
- getParameterTypein interface- BindingParameter<T>
 
 - 
isBindingAllowedpublic boolean isBindingAllowed() Description copied from interface:BindingParameterIf true, the user will be allowed to bind this parameter's runtime value to tags and/or properties- Specified by:
- isBindingAllowedin interface- BindingParameter<T>
 
 - 
getParameterNamepublic java.lang.String getParameterName() Description copied from interface:BindingParameterThe name of this parameter. This is the string that will be used to identify this parameter's value when executing the binding. Must be unique amongst the list of binding parameters for a given binding type.- Specified by:
- getParameterNamein interface- BindingParameter<T>
 
 - 
getTitleKeypublic java.lang.String getTitleKey() Description copied from interface:BindingParameterA resource bundle key to use as the param's title for display purposes.- Specified by:
- getTitleKeyin interface- BindingParameter<T>
 
 - 
getTooltipKeypublic java.lang.String getTooltipKey() Description copied from interface:BindingParameterA resource bundle key to use for the GUI control's tooltip- Specified by:
- getTooltipKeyin interface- BindingParameter<T>
 
 
- 
 
-