Interface IFormReplacerParams
-
- All Superinterfaces:
ILanguageTagProviding
,IReplacerParams
,Serializable
- All Known Subinterfaces:
IPlaceholderValueParams
- All Known Implementing Classes:
DefaultReplacerParameters
public interface IFormReplacerParams extends IReplacerParams, ILanguageTagProviding
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description Mandant
getClient()
default IPlaceholderEscaper
getEscaper()
The placeholder escaper, which should applied for the replaced placeholder values before they returned to the documentdefault Map<String,Integer>
getFieldRepetitions()
When a form element placeholder is replaced and the form element is repeated, all repeated values are joined with a comma by default and used as the replacement value.IFormDataAdapter
getFormData()
FormVersion
getFormVersion()
default String
getLanguageTag()
Vorgang
getProcess()
default IRepetitionContainer
getRepetitionContainer()
Deprecated.Implement / usegetFieldRepetitions()
.boolean
isEncodeForHTML()
Deprecated.default boolean
isEncodeFormValuesForPlaceholder()
default boolean
isReplaceFormPlaceholders()
void
setFormData(IFormDataAdapter formData)
Deprecated.This interface should not allow for modification.
-
-
-
Method Detail
-
getRepetitionContainer
@Deprecated default IRepetitionContainer getRepetitionContainer()
Deprecated.Implement / usegetFieldRepetitions()
.SeegetFieldRepetitions()
for more details.- Returns:
- The repetition context where the replacement is made. May be
null
.
-
getFieldRepetitions
default Map<String,Integer> getFieldRepetitions()
When a form element placeholder is replaced and the form element is repeated, all repeated values are joined with a comma by default and used as the replacement value. When a repetition container is given as the context for the replacement and the form element is inside the same repetition container, only the value at the given index is used.For example, let's say we have a form with the following elements:
- ed1
- fs1 (repeated field set with the following elements)
- tf1
- tf2
- fs2 (repeated field set with the following elements)
- upl1
- upl2
valTf1_1
,valTf1_2
,valTf2_1
,valTf1_2
,valUpl1_1
,valUpl1_2
,valUpl2_1
,valUpl2_2
.Now when we have the placeholder
[%ed1%] [%tf1%] [%upl2%]
, it is replaced byvalEd1_valTf1_1,valTf1_2 valUpl2_1,valUpl2_2
by default.But if we are making the replacement within the context of
upl2
, e.g. when that placeholder is used to compute the file name forupl2
, we want to use only the value of the current repetition forupl2
, not a values joined with a comma.To do this, we can set the field repetitions to
(name="upl2", index=0)
. Then the placeholder evaluates tovalEd1_valTf1_1,valTf1_2 valUpl2_1
. If we set the repetitions to(name="upl1", index=1)
instead, the placeholder evaluates tovalEd1_valTf1_1,valTf1_2 valUpl2_2
.When this logic should be applied to all items in a repeated container, this method may return just that container. If this logic should be applied only to some items of a repeated container, those items must be returned individually. When multiple of the returned containers match, the first is used. Note however, that if you return a container within a repeated container, the children of the inner (non-repeated) container are not resolved automatically.
- Returns:
- The repetition context where the replacement is made. A mapping between the name of a form element and the repetition index for that form element or container.
-
getEscaper
default IPlaceholderEscaper getEscaper()
Description copied from interface:IReplacerParams
The placeholder escaper, which should applied for the replaced placeholder values before they returned to the document- Specified by:
getEscaper
in interfaceIReplacerParams
- Returns:
- an instance of
IPlaceholderEscaper
-
getLanguageTag
default String getLanguageTag()
- Specified by:
getLanguageTag
in interfaceILanguageTagProviding
- Returns:
- The language tag (
Locale.toLanguageTag()
) provided by this object.
-
getFormData
IFormDataAdapter getFormData()
- Returns:
- The
form data adapter
with the data from the curren form record context, if any, for which the placeholder replacement is performed.
-
getFormVersion
FormVersion getFormVersion()
- Returns:
- The
form version
context, if any, for which the placeholder replacement is performed.
-
getProcess
Vorgang getProcess()
- Returns:
- The
form record
context, if any, for which the placeholder replacement is performed.
-
isEncodeForHTML
@Deprecated boolean isEncodeForHTML()
Deprecated.- Returns:
- Use
getEscaper()
.
-
isEncodeFormValuesForPlaceholder
default boolean isEncodeFormValuesForPlaceholder()
- Specified by:
isEncodeFormValuesForPlaceholder
in interfaceIReplacerParams
-
setFormData
@Deprecated void setFormData(IFormDataAdapter formData)
Deprecated.This interface should not allow for modification. Use whatever mechanism you like to fill in he data in your implementing class.- Parameters:
formData
- New form data to use.
-
isReplaceFormPlaceholders
default boolean isReplaceFormPlaceholders()
- Returns:
- When
false
, form placeholders must not be processed at all.
-
-