public abstract class NameAbbreviator
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
NameAbbreviator.MaxElementAbbreviator
Abbreviator that drops starting path elements.
|
private static class |
NameAbbreviator.NOPAbbreviator
Abbreviator that simply appends full name to buffer.
|
private static class |
NameAbbreviator.PatternAbbreviator
Pattern abbreviator.
|
private static class |
NameAbbreviator.PatternAbbreviatorFragment
Fragment of an pattern abbreviator.
|
Modifier and Type | Field and Description |
---|---|
private static NameAbbreviator |
DEFAULT
Default (no abbreviation) abbreviator.
|
Constructor and Description |
---|
NameAbbreviator() |
Modifier and Type | Method and Description |
---|---|
abstract void |
abbreviate(java.lang.String original,
java.lang.StringBuilder destination)
Abbreviates a name in a String.
|
static NameAbbreviator |
getAbbreviator(java.lang.String pattern)
Gets an abbreviator.
|
static NameAbbreviator |
getDefaultAbbreviator()
Gets default abbreviator.
|
private static final NameAbbreviator DEFAULT
public static NameAbbreviator getAbbreviator(java.lang.String pattern)
For example, "%logger{2}" will output only 2 elements of the logger name, "%logger{1.}" will output only the first character of the non-final elements in the name, "%logger(1~.2~} will output the first character of the first element, two characters of the second and subsequent elements and will use a tilde to indicate abbreviated characters.
pattern
- abbreviation pattern.public static NameAbbreviator getDefaultAbbreviator()
public abstract void abbreviate(java.lang.String original, java.lang.StringBuilder destination)
original
- the text to abbreviate, may not be null.destination
- StringBuilder to write the result to