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
public final class ProducerBuilder extends AbstractITextConfigurationEvent
Class is used for producer line building.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
COPYRIGHT_SINCE
private static java.lang.String
COPYRIGHT_TO
private static java.lang.String
CURRENT_DATE
private static char
FORMAT_DELIMITER
private static ProducerBuilder
INSTANCE
private static org.slf4j.Logger
LOGGER
private static java.lang.String
MODIFIED_USING
private static java.util.regex.Pattern
PATTERN
private static java.lang.String
PATTERN_STRING
Pattern is used to search a placeholders.private static java.util.Map<java.lang.String,IPlaceholderPopulator>
PLACEHOLDER_POPULATORS
private static java.lang.String
USED_PRODUCTS
-
Constructor Summary
Constructors Modifier Constructor Description private
ProducerBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.String
buildProducer(java.util.List<ConfirmedEventWrapper> events)
protected void
doAction()
Configuration events for util internal purposes are not expected to be sent.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.private static java.lang.String
populatePlaceholders(java.lang.String producerLine, java.util.List<ConfirmedEventWrapper> events)
-
Methods inherited from class com.itextpdf.commons.actions.AbstractITextConfigurationEvent
addEvent, addProcessor, getActiveProcessor, getEvents, getProcessors, registerInternalNamespace, removeProcessor
-
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
INSTANCE
private static final ProducerBuilder INSTANCE
-
CURRENT_DATE
private static final java.lang.String CURRENT_DATE
- See Also:
- Constant Field Values
-
USED_PRODUCTS
private static final java.lang.String USED_PRODUCTS
- See Also:
- Constant Field Values
-
COPYRIGHT_SINCE
private static final java.lang.String COPYRIGHT_SINCE
- See Also:
- Constant Field Values
-
COPYRIGHT_TO
private static final java.lang.String COPYRIGHT_TO
- See Also:
- Constant Field Values
-
FORMAT_DELIMITER
private static final char FORMAT_DELIMITER
- See Also:
- Constant Field Values
-
MODIFIED_USING
private static final java.lang.String MODIFIED_USING
- See Also:
- Constant Field Values
-
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
-
-
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 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 itext
substring with the current version of itext at the end, no changes will be made- 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:
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)
-
-