public final class StringMangler extends Object
| Constructor and Description |
|---|
StringMangler() |
| Modifier and Type | Method and Description |
|---|---|
static String |
condensePackageString(String classname)
Condenses a classname by stripping down the package name to just the first character of each package name
segment.
|
static String |
maxStringLength(int max,
String raw)
Smash a long string to fit within the max string length, by taking the middle section of the string and replacing them with an ellipsis "..."
|
public static String condensePackageString(String classname)
Examples: "org.eclipse.jetty.test.FooTest" = "oejt.FooTest" "org.eclipse.jetty.server.logging.LogTest" = "oejsl.LogTest"
classname - the fully qualified class namepublic static String maxStringLength(int max, String raw)
Examples: .maxStringLength( 9, "Eatagramovabits") == "Eat...its" .maxStringLength(10, "Eatagramovabits") == "Eat...bits" .maxStringLength(11, "Eatagramovabits") == "Eata...bits"
max - the maximum size of the string (minimum size supported is 9)raw - the raw string to smashCopyright © 1995-2015 Mort Bay Consulting. All Rights Reserved.