Class ProducerBuilder

    • Field Detail

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • PATTERN_STRING

        private static final java.lang.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:
        Constant Field Values
      • PATTERN

        private static final java.util.regex.Pattern PATTERN
      • PLACEHOLDER_POPULATORS

        private static final java.util.Map<java.lang.String,​IPlaceholderPopulator> PLACEHOLDER_POPULATORS
    • Constructor Detail

      • ProducerBuilder

        private ProducerBuilder()
    • Method Detail

      • modifyProducer

        public static java.lang.String modifyProducer​(java.util.List<? extends AbstractProductProcessITextEvent> events,
                                                      java.lang.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 itext substring with the current version of itext at the end, no changes will be made
        Returns:
        modified producer line
      • mergeProducerLines

        public static java.lang.String mergeProducerLines​(java.lang.String firstProducer,
                                                          java.lang.String secondProducer)
        Merges two producer lines. If first producer line null or empty, it will be replaced with the second one. Otherwise second producer line will be attached with modified using prefix. If first producer line already contains modified using substring with the second producer line at the end, first producer line will be returned unchanged.
        Parameters:
        firstProducer - first producer line
        secondProducer - second producer line
        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:
        java.lang.IllegalStateException - on every method call
      • buildProducer

        private static java.lang.String buildProducer​(java.util.List<ConfirmedEventWrapper> events)
      • populatePlaceholders

        private static java.lang.String populatePlaceholders​(java.lang.String producerLine,
                                                             java.util.List<ConfirmedEventWrapper> events)