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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate static final Stringprivate static final charprivate static final ProducerBuilderprivate static final org.slf4j.Loggerprivate static final Stringprivate static final Patternprivate static final StringPattern is used to search a placeholders.private static final Map<String, IPlaceholderPopulator> private static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringbuildProducer(List<ConfirmedEventWrapper> events) protected 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.private static StringpopulatePlaceholders(String producerLine, List<ConfirmedEventWrapper> events) Methods inherited from class AbstractITextConfigurationEvent
addEvent, addProcessor, getActiveProcessor, getEvents, getProcessors, registerInternalNamespace, removeProcessor
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
INSTANCE
-
CURRENT_DATE
- See Also:
-
USED_PRODUCTS
- See Also:
-
COPYRIGHT_SINCE
- See Also:
-
COPYRIGHT_TO
- See Also:
-
FORMAT_DELIMITER
private static final char FORMAT_DELIMITER- See Also:
-
MODIFIED_USING
- See Also:
-
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
-
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 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 documentoldProducer- 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 linesecondProducer- 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
-
buildProducer
-
populatePlaceholders
-