Class MergeFieldsStrategy
java.lang.Object
com.itextpdf.forms.fields.merging.MergeFieldsStrategy
- All Implemented Interfaces:
OnDuplicateFormFieldNameStrategy
A
OnDuplicateFormFieldNameStrategy implementation that merges the second field into the first field if the
second field has the same name as the first field.
This strategy is used by default.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanexecute(PdfFormField firstField, PdfFormField secondField, boolean throwExceptionOnError) executes the strategy.
-
Constructor Details
-
MergeFieldsStrategy
public MergeFieldsStrategy()Creates an instance ofMergeFieldsStrategy
-
-
Method Details
-
execute
public boolean execute(PdfFormField firstField, PdfFormField secondField, boolean throwExceptionOnError) executes the strategy.- Specified by:
executein interfaceOnDuplicateFormFieldNameStrategy- Parameters:
firstField- the first fieldsecondField- the second fieldthrowExceptionOnError- if true, an exception will be thrown- Returns:
- true if the second field was merged successfully, false otherwise
-