Class AlwaysThrowExceptionStrategy

java.lang.Object
com.itextpdf.forms.fields.merging.AlwaysThrowExceptionStrategy
All Implemented Interfaces:
OnDuplicateFormFieldNameStrategy

public class AlwaysThrowExceptionStrategy extends Object implements OnDuplicateFormFieldNameStrategy
A OnDuplicateFormFieldNameStrategy implementation that throws an exception if the second field has the same name as the first field.
  • Constructor Details

  • Method Details

    • execute

      public boolean execute (PdfFormField firstField, PdfFormField secondField, boolean throwExceptionOnError)
      executes the strategy.
      Specified by:
      execute in interface OnDuplicateFormFieldNameStrategy
      Parameters:
      firstField - the first field
      secondField - the second field
      throwExceptionOnError - if true, an exception will be thrown
      Returns:
      true if the second field was renamed successfully, false otherwise