Class ProducerBuilder

All Implemented Interfaces:
IEvent

public final class ProducerBuilder extends AbstractITextConfigurationEvent
Class is used for producer line building.
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • INSTANCE

      private static final ProducerBuilder INSTANCE
    • CURRENT_DATE

      private static final String CURRENT_DATE
      See Also:
    • USED_PRODUCTS

      private static final String USED_PRODUCTS
      See Also:
    • FORMAT_DELIMITER

      private static final char FORMAT_DELIMITER
      See Also:
    • MODIFIED_USING

      private static final String MODIFIED_USING
      See Also:
    • PATTERN_STRING

      private static final String PATTERN_STRING
      Pattern is used to search a placeholders. Currently it searches substrings started with ${ and ended with } without } character inside. These substrings are interpreted as placeholders and the first group is the content of the placeholder. Note: The escape on '}' is necessary for regex dialect compatibility reasons.
      See Also:
    • PATTERN

      private static final Pattern PATTERN
    • PLACEHOLDER_POPULATORS

      private static final Map<String,IPlaceholderPopulator> PLACEHOLDER_POPULATORS
  • Constructor Details

    • ProducerBuilder

      private ProducerBuilder()
  • Method Details

    • modifyProducer

      public static String modifyProducer(List<? extends AbstractProductProcessITextEvent> events, String oldProducer)
      Modifies an old producer line according to events registered for the document. Events can be either wrapped with ConfirmedEventWrapper or not. Format of the new producer line will be defined by the first event in the list. Placeholder will be replaced and merged all together
      Parameters:
      events - list of events registered for the document
      oldProducer - old producer line. If null or empty, will be replaced with a new one. Otherwise new line will be attached with modified using prefix. If old producer line already contains modified using substring, it will be overriden with a new one
      Returns:
      modified producer line
    • doAction

      protected void doAction()
      Configuration events for util internal purposes are not expected to be sent.
      Specified by:
      doAction in class AbstractITextConfigurationEvent
      Throws:
      IllegalStateException - on every method call
    • buildProducer

      private static String buildProducer(List<ConfirmedEventWrapper> events)
    • populatePlaceholders

      private static String populatePlaceholders(String producerLine, List<ConfirmedEventWrapper> events)