Class MergeFieldsStrategy
- java.lang.Object
-
- com.itextpdf.forms.fields.merging.MergeFieldsStrategy
-
- All Implemented Interfaces:
OnDuplicateFormFieldNameStrategy
public class MergeFieldsStrategy extends java.lang.Object implements OnDuplicateFormFieldNameStrategy
AOnDuplicateFormFieldNameStrategy
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 Constructor Description MergeFieldsStrategy()
Creates an instance ofMergeFieldsStrategy
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
execute(PdfFormField firstField, PdfFormField secondField, boolean throwExceptionOnError)
executes the strategy.
-
-
-
Constructor Detail
-
MergeFieldsStrategy
public MergeFieldsStrategy()
Creates an instance ofMergeFieldsStrategy
-
-
Method Detail
-
execute
public boolean execute(PdfFormField firstField, PdfFormField secondField, boolean throwExceptionOnError)
executes the strategy.- Specified by:
execute
in 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
-
-