Class DynamicWordAbbreviator
java.lang.Object
org.apache.logging.log4j.core.pattern.NameAbbreviator
org.apache.logging.log4j.core.pattern.DynamicWordAbbreviator
Specialized abbreviator that shortens all words to the first char except the indicated number of rightmost words.
To select this abbreviator, use pattern 1.n*
where n (> 0) is the number of rightmost words to leave unchanged.
org.apache.logging.log4j.core.pattern.NameAbbreviator
:1.1* => o.a.l.l.c.p.NameAbbreviator 1.2* => o.a.l.l.c.pattern.NameAbbreviator 1.3* => o.a.l.l.core.pattern.NameAbbreviator .. 1.999* => org.apache.logging.log4j.core.pattern.NameAbbreviator
- Since:
- 2.19.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
Right-most number of words (at least one) that will not be abbreviated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
abbreviate
(String original, StringBuilder destination) Abbreviates a name in a String.(package private) static DynamicWordAbbreviator
(package private) static String[]
Methods inherited from class org.apache.logging.log4j.core.pattern.NameAbbreviator
getAbbreviator, getDefaultAbbreviator
-
Field Details
-
rightWordCount
private final int rightWordCountRight-most number of words (at least one) that will not be abbreviated.
-
-
Constructor Details
-
DynamicWordAbbreviator
private DynamicWordAbbreviator(int rightWordCount)
-
-
Method Details
-
create
-
abbreviate
Description copied from class:NameAbbreviator
Abbreviates a name in a String.- Specified by:
abbreviate
in classNameAbbreviator
- Parameters:
original
- the text to abbreviate, may not be null.destination
- StringBuilder to write the result to
-
split
-