public class DefaultBindingParameter<T> extends java.lang.Object implements BindingParameter<T>
getOptionMap()
.BindingParameter.BrowseHelper
Modifier and Type | Field and Description |
---|---|
protected T |
defaultValue |
protected java.lang.String |
parameterName |
protected java.lang.Class<T> |
parameterType |
protected java.lang.String |
titleKey |
Constructor and 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) |
Modifier and Type | Method and Description |
---|---|
T |
coerce(java.lang.String rawValue)
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
|
protected static java.util.List<StringPair> |
createBasicOptionMap(java.lang.String... options)
Creates a basic option map out of a list of Strings
|
protected static java.util.List<StringPair> |
createModuleRPCOptionMap(java.lang.String moduleId,
java.lang.String function)
Just like
createRPCOptionMap(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.BrowseHelper |
getBrowseHelper()
Default implementation returns null.
|
T |
getDefaultValue()
Provide a default value to use for this parameter if the user left the parameter blank
|
java.util.List<StringPair> |
getOptionMap()
Default implementation returns null.
|
java.lang.String |
getParameterName()
The name of this parameter.
|
java.lang.Class<T> |
getParameterType()
The data type of the parameter.
|
java.lang.String |
getTitleKey()
A resource bundle key to use as the param's title for display purposes.
|
java.lang.String |
getTooltipKey()
A resource bundle key to use for the GUI control's tooltip
|
boolean |
isBindingAllowed()
If true, the user will be allowed to bind this parameter's runtime value to tags and/or properties
|
protected java.lang.String parameterName
protected java.lang.String titleKey
protected java.lang.Class<T> parameterType
protected T defaultValue
public DefaultBindingParameter(java.lang.String parameterName, java.lang.String titleKey, T defaultValue)
protected static java.util.List<StringPair> createOrdinalBasedEnumOptions(java.lang.Class<? extends java.lang.Enum> enumClass, boolean includeNone)
includeNone
- If true, a "None" option will be included whose value is empty string.protected static java.util.List<StringPair> createNameBasedEnumOptions(java.lang.Class<? extends java.lang.Enum> enumClass, boolean includeNone)
includeNone
- If true, a "None" option will be included whose value is empty string.protected static java.util.List<StringPair> createBasicOptionMap(java.lang.String... options)
protected static java.util.List<StringPair> createRPCOptionMap(java.lang.String rpcCall)
protected static java.util.List<StringPair> createModuleRPCOptionMap(java.lang.String moduleId, java.lang.String function)
createRPCOptionMap(String)
, but uses module-based rpc instead.public T coerce(java.lang.String rawValue) throws java.lang.ClassCastException
TypeUtilities.coerce(Object, Class)
to coerce rawValue into Tcoerce
in interface BindingParameter<T>
java.lang.ClassCastException
- If this is thrown, the binding will not be executed, instead the property will recieve
a poor data quality.public T getDefaultValue()
getDefaultValue
in interface BindingParameter<T>
public java.util.List<StringPair> getOptionMap()
getOptionMap
in interface BindingParameter<T>
public BindingParameter.BrowseHelper getBrowseHelper()
getBrowseHelper
in interface BindingParameter<T>
public java.lang.Class<T> getParameterType()
BindingParameter
BindingParameter.coerce(String)
function.getParameterType
in interface BindingParameter<T>
public boolean isBindingAllowed()
BindingParameter
isBindingAllowed
in interface BindingParameter<T>
public java.lang.String getParameterName()
BindingParameter
getParameterName
in interface BindingParameter<T>
public java.lang.String getTitleKey()
BindingParameter
getTitleKey
in interface BindingParameter<T>
public java.lang.String getTooltipKey()
BindingParameter
getTooltipKey
in interface BindingParameter<T>