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 String
private static final String
private static final String
private static final char
private static final ProducerBuilder
private static final org.slf4j.Logger
private static final String
private static final Pattern
private static final String
Pattern 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 String
buildProducer
(List<ConfirmedEventWrapper> events) protected void
doAction()
Configuration events for util internal purposes are not expected to be sent.static String
modifyProducer
(List<? extends AbstractProductProcessITextEvent> events, String oldProducer) Modifies an old producer line according to events registered for the document.private static String
populatePlaceholders
(String producerLine, List<ConfirmedEventWrapper> events) Methods inherited from class com.itextpdf.commons.actions.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 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 documentoldProducer
- 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
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 classAbstractITextConfigurationEvent
- Throws:
IllegalStateException
- on every method call
-
buildProducer
-
populatePlaceholders
-