Class FormCollectorImpl

java.lang.Object
ch.tocco.nice2.model.form.impl.form2.reader.FormCollectorImpl
All Implemented Interfaces:
FormCollector

public class FormCollectorImpl extends Object implements FormCollector
Collects and manages form during parsing.
  • Constructor Details

    • FormCollectorImpl

      public FormCollectorImpl()
  • Method Details

    • getOrCreateForm

      public Form getOrCreateForm(String id, Consumer<FormImpl> afterCreateConsumer)
      Specified by:
      getOrCreateForm in interface FormCollector
      Parameters:
      id - the id of the form
      afterCreateConsumer - consumer that runs on the form after it is created
      Returns:
      the form with the given id - create it if it doesn't exist yet
    • removeForm

      public void removeForm(String id)
      Description copied from interface: FormCollector
      remove a form with a specific id from the collector
      Specified by:
      removeForm in interface FormCollector
    • containsForm

      public boolean containsForm(String id)
      Specified by:
      containsForm in interface FormCollector
      Returns:
      true if a form with the given id exists
    • getAllForms

      public Collection<Form> getAllForms()
      Specified by:
      getAllForms in interface FormCollector
      Returns:
      all forms