Class AlwaysThrowExceptionStrategy
- java.lang.Object
-
- com.itextpdf.forms.fields.merging.AlwaysThrowExceptionStrategy
-
- All Implemented Interfaces:
OnDuplicateFormFieldNameStrategy
public class AlwaysThrowExceptionStrategy extends java.lang.Object implements OnDuplicateFormFieldNameStrategy
AOnDuplicateFormFieldNameStrategy
implementation that throws an exception if the second field has the same name as the first field.
-
-
Constructor Summary
Constructors Constructor Description AlwaysThrowExceptionStrategy()
Creates an instance ofAlwaysThrowExceptionStrategy
-
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
-
AlwaysThrowExceptionStrategy
public AlwaysThrowExceptionStrategy()
Creates an instance ofAlwaysThrowExceptionStrategy
-
-
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 renamed successfully, false otherwise
-
-