Package com.itextpdf.text.pdf
Class DefaultSplitCharacter
java.lang.Object
com.itextpdf.text.pdf.DefaultSplitCharacter
- All Implemented Interfaces:
SplitCharacter
The default class that is used to determine whether or not a character is a split character.
You can add an array of characters or a single character on which iText should split the chunk. If custom characters have been set, iText will ignore the default characters this class uses to split chunks.- Since:
- 2.1.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected char[]private static final Patternstatic final SplitCharacterAn instance of the default SplitCharacter. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor, has no custom characters to check.DefaultSplitCharacter(char character) Constructor with one splittable character.DefaultSplitCharacter(char[] characters) Constructor with an array of splittable characters -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleancontainsDate(String data) protected chargetCurrentCharacter(int current, char[] cc, PdfChunk[] ck) Returns the current characterbooleanisSplitCharacter(int start, int current, int end, char[] cc, PdfChunk[] ck) Checks if a character can be used to split aPdfString.
-
Field Details
-
DATE_PATTERN
-
DEFAULT
An instance of the default SplitCharacter. -
characters
protected char[] characters
-
-
Constructor Details
-
DefaultSplitCharacter
public DefaultSplitCharacter()Default constructor, has no custom characters to check. -
DefaultSplitCharacter
public DefaultSplitCharacter(char character) Constructor with one splittable character.- Parameters:
character- char
-
DefaultSplitCharacter
public DefaultSplitCharacter(char[] characters) Constructor with an array of splittable characters- Parameters:
characters- char[]
-
-
Method Details
-
isSplitCharacter
Checks if a character can be used to split a
PdfString.The default behavior is that every character less than or equal to SPACE, the character '-' and some specific unicode ranges are 'splitCharacters'.
If custom splittable characters are set using the specified constructors, then this class will ignore the default characters described in the previous paragraph.- Specified by:
isSplitCharacterin interfaceSplitCharacter- Parameters:
start- start position in the arraycurrent- current position in the arrayend- end position in the arraycc- the character array that has to be checkedck- chunk array- Returns:
trueif the character can be used to split a string,falseotherwise
-
getCurrentCharacter
Returns the current character- Parameters:
current- current position in the arraycc- the character array that has to be checkedck- chunk array- Returns:
- the current character
-
containsDate
-