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 voiddoAction()Configuration events for util internal purposes are not expected to be sent.static StringmergeProducerLines(String firstProducer, String secondProducer) Merges two producer lines.static StringmodifyProducer(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 withConfirmedEventWrapperor 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. Ifnullor empty, will be replaced with a new one. Otherwise new line will be attached withmodified usingprefix. If old producer line already containsmodified using itextsubstring 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 linenullor empty, it will be replaced with the second one. Otherwise second producer line will be attached withmodified usingprefix. If first producer line already containsmodified usingsubstring 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:
-
doActionin classAbstractITextConfigurationEvent - Throws:
-
IllegalStateException- on every method call
-