Package de.xima.fc.form.common.models
Class XValidationParams
java.lang.Object
de.xima.fc.form.common.models.XValidationParams
- All Implemented Interfaces:
IXBaseValidationParams
,IXValidationParams
,Serializable
Simple POJO implementation of
IXValidationParams
.- Author:
- XIMA MEDIA GmbH
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionXValidationParams
(List<String[]> values, Map<String, List<String[]>> valuesMap, int ordinalIndex, Map<String, ? extends IFormContainerMetaData> dynContainerMap, IXItemPropertiesData xItemPropertiesData, IXFormRenderConfig formRenderConfig, Map<Serializable, Serializable> frqSessionAttributes, long clientId, boolean shouldValidate) Creates a new params object with the given data. -
Method Summary
Modifier and TypeMethodDescriptionlong
Map<String,
? extends IFormContainerMetaData> String[]
getI18nValue
(String i18nKey) int
int
boolean
Whether server-side validation should be performed.boolean
isValuesEmpty
(List<String[]> values) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.xima.fc.form.common.models.IXBaseValidationParams
getClientId, getDynContainerMap, getFieldValuesMap, getFormRenderConfig, getFRQSessionAttributes, getI18nValue, getLocale, getValues, isShouldValidate, isValuesEmpty
-
Constructor Details
-
XValidationParams
public XValidationParams(List<String[]> values, Map<String, List<String[]>> valuesMap, int ordinalIndex, Map<String, ? extends IFormContainerMetaData> dynContainerMap, IXItemPropertiesData xItemPropertiesData, IXFormRenderConfig formRenderConfig, Map<Serializable, Serializable> frqSessionAttributes, long clientId, boolean shouldValidate) Creates a new params object with the given data.- Parameters:
values
- The value forIXValidationParams.getValues()
.valuesMap
- The value forIXBaseValidationParams.getFieldValuesMap()
.ordinalIndex
- The 0-based ordinal index of the element repetition.dynContainerMap
- The value forIXBaseValidationParams.getDynContainerMap()
.xItemPropertiesData
- The value forIXValidationParams.getXItemPropertiesData()
.formRenderConfig
- The value forIXBaseValidationParams.getFormRenderConfig()
.frqSessionAttributes
- The value forIXBaseValidationParams.getFRQSessionAttributes()
.clientId
- The value forIXBaseValidationParams.getClientId()
.shouldValidate
- The value forIXBaseValidationParams.isShouldValidate()
.
-
-
Method Details
-
getValues
- Specified by:
getValues
in interfaceIXValidationParams
- Returns:
- The values that were submitted for this form item.
-
getXItemPropertiesData
- Specified by:
getXItemPropertiesData
in interfaceIXValidationParams
- Returns:
- A wrapper object for accessing the properties (
XPropertyEnum
) of the form item to validate.
-
getElementValues
- Specified by:
getElementValues
in interfaceIXValidationParams
- Returns:
- The values that were submitted for this form item, for the current
IXValidationParams.getRepetitionIndex()
. When not a repeated element, this returns the values for the element.
-
getRepetitionIndex
public int getRepetitionIndex()- Specified by:
getRepetitionIndex
in interfaceIXValidationParams
- Returns:
- When the form field is a repeated element: the repetition index (which may neither start at 0 nor is it
necessarily continuous) of the current repetition. When not a repeated element, this returns
-1
.
-
getOrdinalIndex
public int getOrdinalIndex()- Specified by:
getOrdinalIndex
in interfaceIXValidationParams
- Returns:
- When the form field is a repeated element: the 0-based oridnal index of the current repetition. When not
a repeated element, this returns
-1
.
-
getI18nValue
- Specified by:
getI18nValue
in interfaceIXBaseValidationParams
- Parameters:
i18nKey
- I18n key for the localized message.- Returns:
- The localized message for the given key, retrieved from the built-in resource bundle. Plugin resource bundles are not considered.
-
getClientId
public long getClientId()- Specified by:
getClientId
in interfaceIXBaseValidationParams
- Returns:
- The ID of the current client to which the form belongs.
-
getFieldValuesMap
- Specified by:
getFieldValuesMap
in interfaceIXBaseValidationParams
- Returns:
- A map with all values that were submitted. The key is the name of a form field.
-
getFormRenderConfig
- Specified by:
getFormRenderConfig
in interfaceIXBaseValidationParams
- Returns:
- The current form render config for accessing the global configuration of the validation process.
-
getValues
- Specified by:
getValues
in interfaceIXBaseValidationParams
- Parameters:
key
- Name of a form field.- Returns:
- All values that were submitted for the given for the given form field name. The list contains multiple
items when the form field is repeated; the array contains multiple items when the form field submitted
multiple values (e.g. a select element with
multiple
set).
-
getFRQSessionAttributes
- Specified by:
getFRQSessionAttributes
in interfaceIXBaseValidationParams
- Returns:
- All attributes from the current form request session.
-
isValuesEmpty
- Specified by:
isValuesEmpty
in interfaceIXBaseValidationParams
- Parameters:
values
- List of values of a form field.- Returns:
true
if the values are all empty, orfalse
otherwise.
-
getDynContainerMap
- Specified by:
getDynContainerMap
in interfaceIXBaseValidationParams
- Returns:
- A map with the meta data for repeated elements. The key is the name of a form field.
-
isShouldValidate
public boolean isShouldValidate()Description copied from interface:IXBaseValidationParams
Whether server-side validation should be performed. Server-validation may be disabled due to one of several reasons:- The element is not rendered due to a state or user group condition.
- The element is disabled due to a state or user group condition.
- The form action does not require validation. When designing a form, the user can choose whether the form
should be validated when the a submit button is pressed. This returns
true
when a submit button was pressed that requires the form to be validated, andfalse
.
false
. However, there are some use cases when validation needs to be performed no matter the circumstances. In that case, this flag may be ignored.- Specified by:
isShouldValidate
in interfaceIXBaseValidationParams
- Returns:
- Whether the form element should be validated.
-