Class ProducerBuilder
java.lang.Object
com.itextpdf.commons.actions.AbstractITextEvent
com.itextpdf.commons.actions.AbstractITextConfigurationEvent
com.itextpdf.commons.actions.producer.ProducerBuilder
- All Implemented Interfaces:
-
IEvent
Class is used for producer line building.
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doAction()
Configuration events for util internal purposes are not expected to be sent.static String
mergeProducerLines
(String firstProducer, String secondProducer) Merges two producer lines.static String
modifyProducer
(List extends AbstractProductProcessITextEvent> events, String oldProducer) Modifies an old producer line according to events registered for the document.Methods inherited from class com.itextpdf.commons.actions.AbstractITextConfigurationEvent
addEvent, addProcessor, getActiveProcessor, getEvents, getProcessors, registerInternalNamespace, removeProcessor
-
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 withConfirmedEventWrapper
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. Ifnull
or empty, will be replaced with a new one. Otherwise new line will be attached withmodified using
prefix. If old producer line already containsmodified using itext
substring with the current version of itext at the end, no changes will be made - Returns:
- modified producer line
-
mergeProducerLines
Merges two producer lines. If first producer linenull
or empty, it will be replaced with the second one. Otherwise second producer line will be attached withmodified using
prefix. If first producer line already containsmodified 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 classAbstractITextConfigurationEvent
- Throws:
-
IllegalStateException
- on every method call
-