Class AbstractFormattedPlaceholderPopulator
- java.lang.Object
-
- com.itextpdf.commons.actions.producer.AbstractFormattedPlaceholderPopulator
-
- All Implemented Interfaces:
IPlaceholderPopulator
- Direct Known Subclasses:
CurrentDatePlaceholderPopulator,UsedProductsPlaceholderPopulator
abstract class AbstractFormattedPlaceholderPopulator extends java.lang.Object implements IPlaceholderPopulator
Abstract populator for placeholders consuming a parameter which is a pattern string. Any latin letter inside the pattern which is not quoted considered as a param defining the component of the outputted value.
-
-
Field Summary
Fields Modifier and Type Field Description private static charA_LOWERCASEprivate static charA_UPPERCASEprotected static charAPOSTROPHEEscaping character.private static charESCAPE_CHARACTERprivate static charZ_LOWERCASEprivate static charZ_UPPERCASE
-
Constructor Summary
Constructors Constructor Description AbstractFormattedPlaceholderPopulator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intattachQuotedString(int index, java.lang.StringBuilder builder, char[] formatArray)Processes quoted string inside format array.protected booleanisLetter(char ch)Checks if provided character is a latin letter.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.itextpdf.commons.actions.producer.IPlaceholderPopulator
populate
-
-
-
-
Field Detail
-
APOSTROPHE
protected static final char APOSTROPHE
Escaping character.- See Also:
- Constant Field Values
-
ESCAPE_CHARACTER
private static final char ESCAPE_CHARACTER
- See Also:
- Constant Field Values
-
A_UPPERCASE
private static final char A_UPPERCASE
- See Also:
- Constant Field Values
-
Z_UPPERCASE
private static final char Z_UPPERCASE
- See Also:
- Constant Field Values
-
A_LOWERCASE
private static final char A_LOWERCASE
- See Also:
- Constant Field Values
-
Z_LOWERCASE
private static final char Z_LOWERCASE
- See Also:
- Constant Field Values
-
-
Method Detail
-
attachQuotedString
protected int attachQuotedString(int index, java.lang.StringBuilder builder, char[] formatArray)Processes quoted string inside format array. It is expected that provided index points to the apostrophe character so that since theindex + 1position quoted string starts.String may contain escaped apostrophes
\'which processed as characters. Backslash is used for escaping so you need double backslash to print it\\. All the rest backslashes (not followed by apostrophe or one more backslash) are simply ignored.- Parameters:
index- is a index of apostrophe starting a new quoted stringbuilder- is aStringBuilderbuilding a resulting formatted string. It is updated by the method: quoted string is attachedformatArray- is a format representation- Returns:
- index of the character after the closing apostrophe
- Throws:
java.lang.IllegalArgumentException- if there is no closing apostrophe
-
isLetter
protected final boolean isLetter(char ch)
Checks if provided character is a latin letter.- Parameters:
ch- is character to check- Returns:
trueif character is a latin letter andfalseotherwise
-
-